Skip to content

Commit

Permalink
fix(ascii): 修复扩展ascii码无法转换的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mingming-cn committed Oct 18, 2022
1 parent 12f804f commit 4125c3b
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 76 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://EditorConfig.org
# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[*.{js,jsx,ts,tsx,css,scss,less,htm,html}]
indent_style = space
indent_size = 2

[*.{yaml,yml,json}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
indent_size = 4
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://hust.cc', 'https://paypal.me/hustcc', 'https://atool.vip']
custom: ['https://toolb.cn']
210 changes: 210 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,212 @@
# Created by https://www.toptal.com/developers/gitignore/api/jetbrains,linux,windows,macos,yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains,linux,windows,macos,yarn

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# if you are NOT using Zero-installs, then:
# comment the following lines
!.yarn/cache

# and uncomment the following lines
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/jetbrains,linux,windows,macos,yarn

# Logs
logs
*.log
Expand All @@ -12,6 +221,7 @@ lerna-debug.log*

# Node
node_modules/
yarn.lock

# Build
lib
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Xmorse
# IMorse

> **Xmorse** is a pure javascript(~1.5kb) library for encoding / decoding morse code messages, **unicode supported**.
> **IMorse** is a pure javascript(~1.5kb) library for encoding / decoding morse code messages, **unicode supported**.
[中文说明文档](README_ZH.md) | [Online DEMO 地址](https://atool.vip/morse)
[中文说明文档](README_ZH.md) | [Online DEMO 地址](https://toolb.cn/morse)

[![Build Status](https://github.com/hustcc/xmorse/workflows/build/badge.svg)](https://github.com/hustcc/xmorse/actions)
[![Coverage Status](https://coveralls.io/repos/github/hustcc/xmorse/badge.svg?branch=master)](https://coveralls.io/github/hustcc/xmorse?branch=master)
[![npm](https://img.shields.io/npm/v/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![npm](https://img.shields.io/npm/dm/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![npm](https://img.shields.io/npm/l/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![Build Status](https://github.com/mingming-cn/imorse/workflows/build/badge.svg)](https://github.com/mingming-cn/imorse/actions)
[![Coverage Status](https://coveralls.io/repos/github/mingming-cn/imorse/badge.svg?branch=master)](https://coveralls.io/github/mingming-cn/imorse?branch=master)
[![npm](https://img.shields.io/npm/v/imorse.svg)](https://www.npmjs.com/package/imorse)
[![npm](https://img.shields.io/npm/dm/imorse.svg)](https://www.npmjs.com/package/imorse)
[![npm](https://img.shields.io/npm/l/imorse.svg)](https://www.npmjs.com/package/imorse)


# 1. Install

> **npm install xmorse**
> **npm install imorse**
Or download `dist/xmorse.min.js` source file。
Or download `dist/imorse.min.js` source file。

# 2. Import It

- `Script` tag.

```html
<script type="text/javascript" src="dist/xmorse.min.js"></script>
<script type="text/javascript" src="dist/imorse.min.js"></script>
```

- `ES6` style.

```ts
import { decode, encode } from 'xmorse';
import { decode, encode } from 'imorse';
```


Expand All @@ -37,9 +37,9 @@ import { decode, encode } from 'xmorse';
There is only 2 API named `encode`, `decode`. For `encode(msg, [option])`, example:

```ts
import { decode, encode } from 'xmorse';
import { decode, encode } from 'imorse';
// standart morse
encode('Hello, Xmorse!');
encode('Hello, IMorse!');

// unicode
encode('コンニチハ, セカイ!');
Expand All @@ -57,7 +57,7 @@ encode('越过长城,走向世界', option);
For `decode(morse, [option])`, example:

```ts
import { decode, encode } from 'xmorse';
import { decode, encode } from 'imorse';
decode('../.-../---/...-/./-.--/---/..-/-/---/---/--...-....-...-/-..---..-.-----/---..-...--...-/-..----.--.....');

// option
Expand All @@ -81,4 +81,4 @@ $npm test

# 5. LICENSE

MIT@[hustcc](https://github.com/hustcc)
Fork MIT@[hustcc](https://github.com/hustcc)
32 changes: 16 additions & 16 deletions README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Xmorse
# IMorse

> **Xmorse** 是一个纯 JavaScript 开发仅仅只有 1.5kb 的摩斯密码库,支持浏览器端和 nodejs,支持 unicode 字符串,支持中文 morse 密码编码。
> **IMorse** 是一个纯 JavaScript 开发仅仅只有 1.5kb 的摩斯密码库,支持浏览器端和 nodejs,支持 unicode 字符串,支持中文 morse 密码编码。
[English Document](README.md) | [在线 DEMO 地址](https://atool.vip/morse)
[English Document](README.md) | [在线 DEMO 地址](https://toolb.cn/morse)

[![Build Status](https://github.com/hustcc/xmorse/workflows/build/badge.svg)](https://github.com/hustcc/xmorse/actions)
[![Coverage Status](https://coveralls.io/repos/github/hustcc/xmorse/badge.svg?branch=master)](https://coveralls.io/github/hustcc/xmorse?branch=master)
[![npm](https://img.shields.io/npm/v/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![npm](https://img.shields.io/npm/dm/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![npm](https://img.shields.io/npm/l/xmorse.svg)](https://www.npmjs.com/package/xmorse)
[![Build Status](https://github.com/mingming-cn/imorseworkflows/build/badge.svg)](https://github.com/mingming-cn/imorseactions)
[![Coverage Status](https://coveralls.io/repos/github/mingming-cn/imorsebadge.svg?branch=master)](https://coveralls.io/github/mingming-cn/imorse?branch=master)
[![npm](https://img.shields.io/npm/v/imorse.svg)](https://www.npmjs.com/package/imorse)
[![npm](https://img.shields.io/npm/dm/imorse.svg)](https://www.npmjs.com/package/imorse)
[![npm](https://img.shields.io/npm/l/imorse.svg)](https://www.npmjs.com/package/imorse)



# 1. 下载安装

> **npm install xmorse**
> **npm install imorse**
或者直接下载 `dist/xmorse.min.js` 文件。
或者直接下载 `dist/imorse.min.js` 文件。


# 2. 引入库

- `script` 标签引入.

```html
<script type="text/javascript" src="dist/xmorse.min.js"></script>
<script type="text/javascript" src="dist/imorse.min.js"></script>
```

- `import` 语法风格.

```ts
import { encode, decode } from 'xmorse';
import { encode, decode } from 'imorse';
```


Expand All @@ -39,10 +39,10 @@ import { encode, decode } from 'xmorse';
这个库仅仅只有两个 API 方法,分别为: `encode``decode`。对于 API `encode(msg, [option])`,例子如下:

```ts
import { encode, decode } from 'xmorse';
import { encode, decode } from 'imorse';

// 编码标准 摩斯密码
encode('Hello, Xmorse!');
encode('Hello, IMorse!');

// 对于 unicode 编码
encode('越过长城,走向世界');
Expand All @@ -59,7 +59,7 @@ encode('越过长城,走向世界', option);
对于 API `decode(morse, [option])`,例子如下:

```ts
import { encode, decode } from 'xmorse';
import { encode, decode } from 'imorse';

decode('../.-../---/...-/./-.--/---/..-/-/---/---/--...-....-...-/-..---..-.-----/---..-...--...-/-..----.--.....');

Expand All @@ -84,4 +84,4 @@ $npm test

# 5. 开源协议

MIT@[hustcc](https://github.com/hustcc)
Fork MIT@[hustcc](https://github.com/hustcc)
Loading

0 comments on commit 4125c3b

Please sign in to comment.