Skip to content

Commit

Permalink
add example and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
azi-acceis committed Feb 16, 2024
1 parent 50a2f9d commit 6e855dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/unisec/cli/hexdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module Commands
# UTF-16LE: 4100 4300 4300 4500 4900 5300
# UTF-32BE: 00000041 00000043 00000043 00000045 00000049 00000053
# UTF-32LE: 41000000 43000000 43000000 45000000 49000000 53000000
#
# $unisec hexdump "ACCEIS" --enc utf16le
# 4100 4300 4300 4500 4900 5300
# ```
class Hexdump < Dry::CLI::Command
desc 'Hexdump in all Unicode encodings'
Expand Down
1 change: 1 addition & 0 deletions lib/unisec/hexdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def self.utf32le(str)
end

# Display a CLI-friendly output summurizing the hexdump in all Unicode encodings
# @return [String] CLI-ready output
# @example
# puts Unisec::Hexdump.new('K').display # =>
# # UTF-8: e2 84 aa
Expand Down
1 change: 1 addition & 0 deletions lib/unisec/surrogates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def code_point
# Display a CLI-friendly output summurizing everithing about the surrogates:
# the corresponding character, code point, high and low surrogates
# (each displayed as hexadecimal, decimal and binary).
# @return [String] CLI-ready output
# @example
# surr = Unisec::Surrogates.new(128169)
# puts surr.display # =>
Expand Down

0 comments on commit 6e855dc

Please sign in to comment.