Bodge.app

global crypto

Cryptographic functions.


methods


M.md5


function M.md5(data: string) ->  Hash {
    digest = function,
    hexdigest = function,
}

MD5 Hasher

Warning: MD5 is not a cryptographically secure hasher, this is provided for backwards compatability only.

M.sha1


function M.sha1(data: string) ->  Hash {
    digest = function,
    hexdigest = function,
}

SHA1 Hasher

Warning: SHA1 is not a cryptographically secure hasher, this is provided for backwards compatability only.

M.sha1cd


function M.sha1cd(data: string) ->  Hash {
    digest = function,
    hexdigest = function,
}

SHA1 (Collision Detection) Hasher

Warning: SHA1 is not a cryptographically secure hasher. This hasher may provide more security than standard SHA1 by attempting to check for collision attacks, however you should use a more secure hasher if you have the option.

M.sha256


function M.sha256(data: string) ->  Hash {
    digest = function,
    hexdigest = function,
}

SHA256 Hasher

M.hmac


function M.hmac(
  key: string,
  data: string,
  hasher: Hasher
) ->  Hash {
    digest = function,
    hexdigest = function,
}

HMAC

M.random


function M.random(bytes: number)-> string

Random

Generate the given number of bytes of randomness, returned as a raw binary string.