1 | sS sha256(S text) ctex {
|
2 | if (text == null) ret "-"; |
3 | return bytesToHex(sha256_impl(toUtf8(text))); |
4 | } |
5 | |
6 | sS sha256(byte[] data) {
|
7 | if (data == null) ret "-"; |
8 | ret bytesToHex(sha256_impl(data)); |
9 | } |
10 | |
11 | static byte[] sha256_impl(byte[] data) ctex {
|
12 | return MessageDigest.getInstance("SHA-256").digest(data);
|
13 | } |
Began life as a copy of #1000998
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1023345 |
| Snippet name: | sha256 |
| Eternal ID of this version: | #1023345/1 |
| Text MD5: | 36908ec572a5a114d15c7d92440321e0 |
| 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:49 |
| Source code size: | 318 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 420 / 469 |
| Referenced in: | [show references] |