83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
19 lines
399 B
TypeScript
19 lines
399 B
TypeScript
import { md5 } from '@speckle/shared'
|
|
export { md5 }
|
|
|
|
export const base64Encode = (str: string): string => {
|
|
if (import.meta.server) {
|
|
return Buffer.from(str).toString('base64')
|
|
} else {
|
|
return btoa(str)
|
|
}
|
|
}
|
|
|
|
export const base64Decode = (str: string): string => {
|
|
if (import.meta.server) {
|
|
return Buffer.from(str, 'base64').toString('utf8')
|
|
} else {
|
|
return atob(str)
|
|
}
|
|
}
|