Skip to content

Commit

Permalink
refactor: switch to RFC4648 base32 ids
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeyfyi committed Mar 25, 2021
1 parent e238bde commit 1870cc6
Show file tree
Hide file tree
Showing 1,101 changed files with 59 additions and 2 deletions.
6 changes: 4 additions & 2 deletions IconGenerator/generate.js
@@ -1,7 +1,7 @@
import fs from 'fs/promises';
import YAML from 'yaml'
import ora from 'ora';
import base32 from 'base32';
import base32Encode from 'base32-encode';
import tmp from 'tmp-promise';
import { promisify } from 'util';
import { exec } from 'child_process';
Expand All @@ -21,7 +21,9 @@ Utils
*/

function symbolId(symbol) {
return base32.encode(`${symbol.package}-${symbol.fontenc}-${symbol.symbol.replace("\\", "_")}`)
let id = `${symbol.package}-${symbol.fontenc}-${symbol.symbol.replace("\\", "_")}`;
let buffer = new TextEncoder().encode(id);
return base32Encode(buffer, 'RFC4648', { padding: false });
}

function asyncPoolProgress(poolLimit, array, iteratorFn, tickCallback) {
Expand Down
53 changes: 53 additions & 0 deletions IconGenerator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions IconGenerator/package.json
Expand Up @@ -10,8 +10,10 @@
"author": "",
"license": "MIT",
"dependencies": {
"base32-encode": "^1.1.1",
"ora": "^5.4.0",
"svgo": "github:zoeyfyi/svgo#dereferenceUses-plugin-fix",
"tiny-async-pool": "^1.2.0",
"tmp-promise": "^3.0.2",
"yaml": "^1.10.2"
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 1870cc6

Please sign in to comment.