本文へ移動
mie リファレンス
REPL Playground

std:crypto リファレンス

@import 'std:crypto' で取得する暗号ハッシュモジュール。sha1 / sha256 / md5 (Bytes → Bytes・純粋・同期) を提供する。

md5

md5(bytes)
md5: { Bytes | Bytes }

MD5 ダイジェスト (16 bytes)。新規のセキュリティ用途には sha256 を使う。

>>> crypto.md5("abc".to_bytes!)
<16 bytes>

sha1

sha1(bytes)
sha1: { Bytes | Bytes }

SHA-1 ダイジェスト (20 bytes)。新規のセキュリティ用途には sha256 を使う。

>>> crypto.sha1("abc".to_bytes!)
<20 bytes>

sha256

sha256(bytes)
sha256: { Bytes | Bytes }

SHA-256 ダイジェスト (32 bytes)。

>>> crypto.sha256("abc".to_bytes!)
<32 bytes>