Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1000998 - md5

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1539L/11K).

static S md5(String text) ctex {
  if (text == null) ret "-";
  return bytesToHex(md5_impl(toUtf8(text))); // maybe different than the way PHP does it...
}

static S md5(byte[] data) {
  if (data == null) ret "-";
  ret bytesToHex(md5_impl(data));
}

static byte[] md5_impl(byte[] data) ctex {
  return MessageDigest.getInstance("MD5").digest(data);
}

static S md5(File file) {
  ret md5OfFile(file);
}

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, tslmcundralx, tvejysmllsmz, whxojlpjdney

No comments. add comment

Snippet ID: #1000998
Snippet name: md5
Eternal ID of this version: #1000998/4
Text MD5: 60b70306aeb5654956029e177b41893d
Transpilation MD5: b3f9d9eff564f43ab83ecf19f6d3b63f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-06 20:50:39
Source code size: 419 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 4843
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1000998 & http://1000998.tinybrain.de