Changelog

This commit is contained in:
Philipp Heckel 2022-12-08 09:16:59 -05:00
parent 420d289d35
commit 18596ecc34
4 changed files with 16 additions and 16 deletions

View file

@ -94,7 +94,6 @@ export const unmatchedTags = (tags) => {
else return tags.filter(tag => !(tag in emojis));
}
export const maybeWithBasicAuth = (headers, user) => {
if (user) {
headers['Authorization'] = `Basic ${encodeBase64(`${user.username}:${user.password}`)}`;
@ -241,3 +240,12 @@ export async function* fetchLinesIterator(fileURL, headers) {
yield chunk.substr(startIndex); // last line didn't end in a newline char
}
}
export const randomAlphanumericString = (len) => {
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
let id = "";
for (let i = 0; i < len; i++) {
id += alphabet[(Math.random() * alphabet.length) | 0];
}
return id;
}