Skip to content

Instantly share code, notes, and snippets.

@thesadabc
Created December 6, 2023 07:17
Show Gist options
  • Save thesadabc/7099518b47f6b0fa863b052a0516316e to your computer and use it in GitHub Desktop.
Save thesadabc/7099518b47f6b0fa863b052a0516316e to your computer and use it in GitHub Desktop.
常用汉字3000个
/**
* GB2312编码,按汉字使用频率,前3000个既为常用汉字
**/
const decode = new TextDecoder("gb2312");
export default new Set(new Array(3756).fill("").map((_, i) =>
decode.decode(Uint8Array.from([176 + Math.floor(i / 94), 161 + i % 94])),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment