aviary-ps/src/ffi.js

29 lines
715 B
JavaScript

export function arrayBufferToBlob(mime) {
return function(data) {
return new Blob([data], {type: mime})
}
}
export const nonce_a = new Uint8Array([0xd0, 0xc3, 0x75, 0x56, 0x58, 0xc1, 0x7e, 0x5f, 0xd6, 0xcc, 0xb6, 0x76]).buffer
export const nonce_b = new Uint8Array([0x77, 0xe7, 0xf7, 0x64, 0x33, 0x80, 0x25, 0x49, 0xec, 0xef, 0x57, 0x3f]).buffer
export function decodeBlurhashImpl(just) {
return function(nothing) {
return function(x) {
return function(y) {
return function(blurhash) {
try {
return just(BlurHash.toDataURL(blurhash, x, y))
} catch(_) {
return nothing
}
}
}
}
}
}
export function removeSpinner() {
document.getElementById("spinner").remove()
}