Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const sysex = encodeSysexData(encodeProgram(this.props.program));
const data = pako.deflate(sysex);
const encodedProgram = base32Encode(data, 'Crockford');
const location = createLocation(`/?sysex=${encodedProgram}`, null, null, history.location);
const href = history.createHref(location);
const current = window.location;
const url = urljoin(`${current.protocol}//${current.host}`, href);
return (
<div style="{{">
<p>Use this link to share your program</p>
<input value="{url}" readonly="{true}" style="{{" type="text"> { this.el = el; }}
/>
</div>
export const keyEncoder: KeyEncoder = (
secret: SecretKey,
encoding: KeyEncodings
): Base32SecretKey => {
return base32Encode(Buffer.from(secret, encoding), 'RFC4648', {
padding: false
});
};