UNPKG

@better-auth/utils

Version:

A collection of utilities for better-auth

17 lines (14 loc) 387 B
'use strict'; const decoders = /* @__PURE__ */ new Map(); const encoder = new TextEncoder(); const binary = { decode: (data, encoding = "utf-8") => { if (!decoders.has(encoding)) { decoders.set(encoding, new TextDecoder(encoding)); } const decoder = decoders.get(encoding); return decoder.decode(data); }, encode: encoder.encode }; exports.binary = binary;