unsecure
IntroductionCryptoGenerateSafetyRecipes
  • Safety
  • Parse untrusted JSON
  • Encode and decode
  • Handle errors

Safety

Read input from outside without letting it steer your code: parse JSON, decode encoded text, and handle the errors both can throw.

Parse untrusted JSON

Parse a request body, or clean one already parsed, without the keys that cause prototype pollution.

Encode and decode

Turn bytes into hex, base64 or base32 text and back, accepting only the canonical spelling.

Handle errors

Catch UnsecureError, tell a client's mistake from your own by its code, and answer each one.

Edit this page
Previous Give rewards at the promised rate Next Parse untrusted JSON

unsecure  Cryptographic utilities on the Web Crypto API.