Files
speckle-server/packages/frontend-2/lib/common/helpers/encodeDecode.ts
T
Kristaps Fabians Geikins 73abba06cf feat(fe2): pagination for various automate UIs (#2324)
* WIP infinite load helper

* finished automations pagination

* runs pagination working

* fn pagination

* minor cleanup

* subscription cache mutation fixes

* filtered cache update fix

* minor changes
2024-06-05 12:18:13 +03:00

19 lines
391 B
TypeScript

import { md5 } from '@speckle/shared'
export { md5 }
export const base64Encode = (str: string): string => {
if (process.server) {
return Buffer.from(str).toString('base64')
} else {
return btoa(str)
}
}
export const base64Decode = (str: string): string => {
if (process.server) {
return Buffer.from(str, 'base64').toString('utf8')
} else {
return atob(str)
}
}