├── docs
├── .nojekyll
├── yard
│ ├── css
│ │ ├── common.css
│ │ └── full_list.css
│ ├── frames.html
│ ├── file.about.html
│ ├── top-level-namespace.html
│ ├── Unisec
│ │ ├── Utils.html
│ │ ├── CLI.html
│ │ ├── Bidi.html
│ │ └── CLI
│ │ │ ├── Commands
│ │ │ ├── Bidi.html
│ │ │ ├── Surrogates.html
│ │ │ ├── Normalize.html
│ │ │ ├── Confusables.html
│ │ │ ├── Properties.html
│ │ │ ├── Properties
│ │ │ │ └── List.html
│ │ │ ├── Versions.html
│ │ │ ├── Grep.html
│ │ │ └── Size.html
│ │ │ └── Commands.html
│ ├── file.documentation.html
│ ├── file.LICENSE.html
│ ├── file_list.html
│ ├── file.quick-start.html
│ ├── file.publishing.html
│ ├── file.CHANGELOG.html
│ ├── Unisec.html
│ ├── index.html
│ ├── file.README.html
│ └── file.install.html
├── _media
│ ├── unisec-logo.png
│ └── unisec-favicon.ico
├── _navbar.md
├── about.md
├── _coverpage.md
├── _sidebar.md
├── pages
│ ├── documentation.md
│ ├── quick-start.md
│ ├── publishing.md
│ ├── install.md
│ └── usage.md
├── CHANGELOG.md
├── index.html
└── vendor
│ ├── plugins
│ ├── docsify-image-caption.min.js
│ └── docsify-sidebar-collapse.min.js
│ └── prismjs
│ └── components
│ └── prism-ruby.min.js
├── .tool-versions
├── docs-tools
├── .tool-versions
├── package.json
└── gulpfile.mjs
├── .gitignore
├── lib
├── unisec
│ ├── version.rb
│ ├── cli
│ │ ├── rugrep.rb
│ │ ├── size.rb
│ │ ├── versions.rb
│ │ ├── cli.rb
│ │ ├── hexdump.rb
│ │ ├── confusables.rb
│ │ ├── surrogates.rb
│ │ ├── properties.rb
│ │ ├── bidi.rb
│ │ └── normalization.rb
│ ├── confusables.rb
│ ├── versions.rb
│ ├── hexdump.rb
│ ├── utils.rb
│ ├── surrogates.rb
│ ├── normalization.rb
│ ├── rugrep.rb
│ └── size.rb
└── unisec.rb
├── bin
└── unisec
├── .yardopts
├── Rakefile
├── .editorconfig
├── test
├── test_versions.rb
├── test_confusables.rb
├── test_normalization.rb
├── test_rugrep.rb
├── test_surrogates.rb
├── test_hexdump.rb
├── test_size.rb
├── test_properties.rb
└── test_bidi.rb
├── .github
├── dependabot.yml
└── workflows
│ └── ruby.yml
├── .rubocop.yml
├── LICENSE
├── Gemfile
├── unisec.gemspec
├── Gemfile.lock
└── README.md
/docs/.nojekyll:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.tool-versions:
--------------------------------------------------------------------------------
1 | ruby 3.3.0
2 |
--------------------------------------------------------------------------------
/docs-tools/.tool-versions:
--------------------------------------------------------------------------------
1 | nodejs 20.0.0
2 |
--------------------------------------------------------------------------------
/docs/yard/css/common.css:
--------------------------------------------------------------------------------
1 | /* Override this file with custom rules */
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Documentation
2 | docs-tools/node_modules
3 | .yardoc
4 | pkg
5 |
--------------------------------------------------------------------------------
/docs/_media/unisec-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acceis/unisec/HEAD/docs/_media/unisec-logo.png
--------------------------------------------------------------------------------
/docs/_media/unisec-favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acceis/unisec/HEAD/docs/_media/unisec-favicon.ico
--------------------------------------------------------------------------------
/lib/unisec/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Unisec
4 | # Version of unisec library and app
5 | VERSION = '0.0.6'
6 | end
7 |
--------------------------------------------------------------------------------
/docs/_navbar.md:
--------------------------------------------------------------------------------
1 | - [Home](/)
2 | - [Library documentation](https://acceis.github.io/unisec/yard/Unisec)
3 | - [Source](https://github.com/Acceis/unisec)
4 |
--------------------------------------------------------------------------------
/bin/unisec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | require 'unisec'
5 | require 'unisec/cli/cli'
6 |
7 | Dry::CLI.new(Unisec::CLI::Commands).call
8 |
--------------------------------------------------------------------------------
/.yardopts:
--------------------------------------------------------------------------------
1 | --output-dir docs/yard
2 | --markup markdown
3 | --markup-provider commonmarker
4 | --plugin coderay
5 | -
6 | --main README.md
7 | docs/pages/*.md
8 | docs/CHANGELOG.md
9 | docs/about.md
10 | LICENSE
11 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'rake/testtask'
4 | require 'bundler/gem_tasks'
5 |
6 | Rake::TestTask.new(:test) do |t|
7 | t.libs << 'test'
8 | t.libs << 'lib'
9 | t.test_files = FileList['test/**/test_*.rb']
10 | end
11 |
12 | desc 'Run tests'
13 | task default: :test
14 |
--------------------------------------------------------------------------------
/docs/about.md:
--------------------------------------------------------------------------------
1 | # About
2 |
3 | ## Logo
4 |
5 | Logo made with [DesignEvo](https://www.designevo.com).
6 |
7 | ## User documentation
8 |
9 | The user documentation is made with [docsify](https://docsify.js.org), the theme
10 | used is [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable)
11 | (Simple Dark scheme).
12 |
--------------------------------------------------------------------------------
/docs/_coverpage.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # unisec
4 |
5 | > Unicode Security Toolkit
6 |
7 | [Quick start](pages/quick-start?id=quick-start)
8 | [Install](pages/install)
9 | [Usage](pages/usage)
10 | [Changelog](CHANGELOG)
11 |
12 | 
13 |
14 |
--------------------------------------------------------------------------------
/docs/_sidebar.md:
--------------------------------------------------------------------------------
1 | - Getting started
2 |
3 | - [Quick start](pages/quick-start.md)
4 | - [Installation](pages/install.md)
5 | - [Usage](pages/usage.md)
6 |
7 | - Development
8 |
9 | - [Documentation](pages/documentation.md)
10 | - [Publishing](pages/publishing.md)
11 |
12 | - [About](about.md)
13 | - [Changelog](CHANGELOG.md)
14 |
--------------------------------------------------------------------------------
/lib/unisec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'unisec/version'
4 |
5 | require 'unisec/bidi'
6 | require 'unisec/confusables'
7 | require 'unisec/hexdump'
8 | require 'unisec/normalization'
9 | require 'unisec/properties'
10 | require 'unisec/rugrep'
11 | require 'unisec/size'
12 | require 'unisec/surrogates'
13 | require 'unisec/versions'
14 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Unix-style newlines with a newline ending every file
7 | [*]
8 | end_of_line = lf
9 | insert_final_newline = true
10 |
11 | # ruby
12 | [*.rb]
13 | charset = utf-8
14 | indent_style = space
15 | indent_size = 2
16 | trim_trailing_whitespace = true
17 |
--------------------------------------------------------------------------------
/test/test_versions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: false
2 |
3 | require 'minitest/autorun'
4 | require 'unisec'
5 |
6 | class UnisecTest < Minitest::Test
7 | def test_unisec_versions_versions
8 | data = Unisec::Versions.versions
9 | assert_kind_of(Hash, data)
10 | data.each do |_k, v|
11 | assert(v.key?(:version))
12 | assert(v.key?(:label))
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/docs/pages/documentation.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 |
3 | ## CLI doc
4 |
5 | See [Usage](pages/usage.md?id=cli).
6 |
7 | ### Serve locally
8 |
9 | ```
10 | $ npm i docsify-cli gulp-cli -g
11 | $ cd docs-tools
12 | $ npm i
13 | $ gulp
14 | $ docsify serve ../docs
15 | ```
16 |
17 | ## Library doc
18 |
19 | The output directory of the library documentation will be `docs/yard`.
20 |
21 | You can consult it online [here](https://acceis.github.io/unisec/yard/).
22 |
23 | ### Build & serve locally
24 |
25 | ```
26 | $ bundle exec yard doc && bundle exec yard server
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/pages/quick-start.md:
--------------------------------------------------------------------------------
1 | # Quick start
2 |
3 | ## Quick install
4 |
5 | ```
6 | $ gem install unisec
7 | ```
8 |
9 | ## Default usage: CLI
10 |
11 | Example converting surrogates to code point.
12 |
13 | ```
14 | $ unisec surrogates from 0xD801 0xDC37
15 | Char: 𐐷
16 | Code Point: 0x10437, 0d66615, 0b10000010000110111
17 | High Surrogate: 0xD801, 0d55297, 0b1101100000000001
18 | Low Surrogate: 0xDC37, 0d56375, 0b1101110000110111
19 | ```
20 |
21 | ## Default usage: library
22 |
23 | ```ruby
24 | require 'unisec'
25 |
26 | surr = Unisec::Surrogates.new(55357, 56489)
27 | surr.code_point # => 128169
28 | ```
29 |
--------------------------------------------------------------------------------
/test/test_confusables.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: false
2 |
3 | require 'minitest/autorun'
4 | require 'unisec'
5 |
6 | class UnisecTest < Minitest::Test
7 | def test_unisec_confusables_list
8 | data = Unisec::Confusables.list('!')
9 | assert_kind_of(Array, data)
10 | assert_kind_of(String, data.first)
11 | assert_equal(['!', 'ǃ', 'ⵑ', '‼', '⁉', '⁈'], data)
12 | end
13 |
14 | def test_unisec_confusables_randomize
15 | assert_kind_of(String, Unisec::Confusables.randomize('noraj'))
16 | # Should not fail when then is no confusable alternative
17 | assert_equal('é🚀', Unisec::Confusables.randomize('é🚀'))
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/docs/yard/frames.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |