Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Created February 18, 2024 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Code-Hex/863b958bc89b9f339efb477103ab4453 to your computer and use it in GitHub Desktop.
Save Code-Hex/863b958bc89b9f339efb477103ab4453 to your computer and use it in GitHub Desktop.
pemToBinary
export function pemToBinary(pem: string): Uint8Array {
return decodeBase64(pem.replace(/-+(BEGIN|END).*/g, '').replace(/\s/g, ''))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment