defold (official)
defold/extension-crypt/crypt
Functions and constants for interacting with various hash and encode/decode algorithms
- GitHub: defold/extension-crypt — pinned to
1.1.0(released while Defold 1.4.7 was current)- Pick a release from defold/extension-crypt releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as crypt from "crypt"
- Pick a release from defold/extension-crypt releases and add its Source code (zip) URL (or a packaged
Functions
crypt.hash_sha1(buffer: string): stringcrypt.hash_sha256(buffer: string): stringcrypt.hash_sha512(buffer: string): stringcrypt.hash_md5(buffer: string): stringcrypt.encode_base64(input: string): stringcrypt.decode_base64(input: string): stringcrypt.encrypt_xtea(source: string, key: string): stringcrypt.decrypt_xtea(source: string, key: string): string
crypt.hash_sha1(buffer: string): string
Parameters
buffer:string
Returns
output:string
crypt.hash_sha256(buffer: string): string
Parameters
buffer:string
Returns
output:string
crypt.hash_sha512(buffer: string): string
Parameters
buffer:string
Returns
output:string
crypt.hash_md5(buffer: string): string
Parameters
buffer:string
Returns
output:string
crypt.encode_base64(input: string): string
Parameters
input:string
Returns
output:string
crypt.decode_base64(input: string): string
Parameters
input:string
Returns
output:string
crypt.encrypt_xtea(source: string, key: string): string
Parameters
source:stringkey:string— key should be <=16
Returns
output:string
crypt.decrypt_xtea(source: string, key: string): string
Parameters
source:stringkey:string— key should be <=16
Returns
output:string