MCPcopy
hub / github.com/remotely-save/remotely-save / encryptStringToBase32

Function encryptStringToBase32

src/encryptOpenSSL.ts:108–121  ·  view source on GitHub ↗
(
  text: string,
  password: string,
  rounds: number = DEFAULT_ITER,
  saltHex = ""
)

Source from the content-addressed store, hash-verified

106};
107
108export const encryptStringToBase32 = async (
109 text: string,
110 password: string,
111 rounds: number = DEFAULT_ITER,
112 saltHex = ""
113) => {
114 const enc = await encryptArrayBuffer(
115 bufferToArrayBuffer(new TextEncoder().encode(text)),
116 password,
117 rounds,
118 saltHex
119 );
120 return base32.stringify(new Uint8Array(enc), { pad: false });
121};
122
123export const decryptBase32ToString = async (
124 text: string,

Callers 1

Calls 2

bufferToArrayBufferFunction · 0.90
encryptArrayBufferFunction · 0.85

Tested by

no test coverage detected