Download server/src/common/util.js from linuxrun/deer: direct link, hf CLI and curl.
- Browser
- Download file 500 Bytes
-
https://huggingface.co/spaces/linuxrun/deer/resolve/main/server/src/common/util.js
- Command line
-
hf download hf://spaces/linuxrun/deer/server/src/common/util.js
-
curl -L -o util.js https://huggingface.co/spaces/linuxrun/deer/resolve/main/server/src/common/util.js
500 Bytes
| import moment from 'moment'; | |
| export function getRandomString(len) { | |
| let result = ''; | |
| // const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
| const characters = '123456789'; | |
| const charactersLength = characters.length; | |
| for (let i = 0; i < len; i++) { | |
| result += characters.charAt(Math.floor(Math.random() * charactersLength)); | |
| } | |
| return result; | |
| } | |
| export function formatDatetimeForMySQL(datetime) { | |
| return moment(datetime).format(DATE_TIME_FORMAT); | |
| } | |