Skip to Content
defold-typescript libraries
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)
    1. Pick a release from defold/extension-crypt releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as crypt from "crypt"

Functions

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: string
  • key: string — key should be <=16

Returns

  • output: string

crypt.decrypt_xtea(source: string, key: string): string

Parameters

  • source: string
  • key: string — key should be <=16

Returns

  • output: string

On this page