UNPKG

@shopify/shopify-api

Version:

Shopify API Library for Node - accelerate development with support for authentication, graphql proxy, webhooks

16 lines (11 loc) 272 B
export type Nonce = () => string; export function nonce(): string { const length = 15; const bytes = crypto.getRandomValues(new Uint8Array(length)); const nonce = bytes .map((byte: number) => { return byte % 10; }) .join(''); return nonce; }