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

Function encryptStringToBase64url

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

Source from the content-addressed store, hash-verified

135};
136
137export const encryptStringToBase64url = async (
138 text: string,
139 password: string,
140 rounds: number = DEFAULT_ITER,
141 saltHex = ""
142) => {
143 const enc = await encryptArrayBuffer(
144 bufferToArrayBuffer(new TextEncoder().encode(text)),
145 password,
146 rounds,
147 saltHex
148 );
149 return base64url.stringify(new Uint8Array(enc), { pad: false });
150};
151
152export const decryptBase64urlToString = async (
153 text: string,

Callers 1

Calls 2

bufferToArrayBufferFunction · 0.90
encryptArrayBufferFunction · 0.85

Tested by

no test coverage detected