Git Product home page Git Product logo

sublime-codec's Introduction

Sublime Codec for ST2 and ST3

Build Status

Provides a bunch of useful codecs as a Sublime Text plugin to allow you to work with:

  • RFC 4648:
    • encode/decode base64 (standard and url safe)
    • encode/decode base32
    • encode/decode base16 (hex)
  • RFC 1321:
    • MD5
  • FIPS 180-2:
    • SHA-1
    • SHA-224
    • SHA-256
    • SHA-384
    • SHA-512
  • RFC 3986 URL encoding (percent encoding):
    • URL encoding (classic)
    • URL encoding (new school plus instead of %20 method)
  • RFC 1522:
    • encode/decode MIME quoted-printable
  • Extensible Markup Language (XML) 1.0 (Fifth Edition):
    • escape/unescape character decoding
  • RFC 4627:
    • JSON encoding/decode
    • JSON encoding with escaped Unicode
  • C-style byte strings
  • RFC 3490 / RFC 5891:
    • International Domain Names in Applications (IDNA)
  • RFC 3492:
    • Punycode
  • Base62
  • CSP Hash Source

Limitations

  • Note that this plugin assumes that your file is UTF-8 encoded.

Installation

Package Control

  • Install Package Control https://sublime.wbond.net/installation
  • Pull up the command palette (Shift+Super+P)
  • Type Package Control: Install Package and press return key
  • Type Codec and press return key
  • Enjoy

Manual Install

Usage

  • Look in the selection menu
  • Look in command palette under Codec (Shift+Super+P to bring up palette)
  • Ctrl+Super+Y to base64 encode
  • Shift+Super+Y to base64 decode

sublime-codec's People

Contributors

furikake avatar iffy avatar nagromc avatar soulgain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublime-codec's Issues

Unicode code points (web style)

This should output both hexadecimal and decimal style.

Example encode 日本語 to

  • 日本語
  • 日本語

[Feature request] IDNA2008 standard for punycode

1. Request

It would be nice, if you add IDNA2008 standard support for punycode like https://www.punycoder.com/.

2. Justification

For example, I have a link:

http://www.россия.рф/

If I convert link in https://www.punycoder.com/, I get result:

http://www.xn--h1alffa9f.xn--p1ai/

This link successful open in browsers.

If I convert link use your package, I get result:

http://www../-e5k3f5adpa7dun

If I insert this link in URL bar → I press Enter → link don't open for me → Firefox and Chrome hangs.

3. Desirable behavior

I select http://www.россия.рф/Ctrl+Shift+PCodec: Punycode encode → link convert to http://www.xn--h1alffa9f.xn--p1ai/.

Thanks.

Unicode code points

This should output both \uHHHH, \UHHHHHH and U+HHHH styles.

Example encode 日本語 to

  • \u65e5\u672c\u8a9e
  • U+65e5U+672cU+8a9e

C style code point (ascii) and unicode

A unicode character such as should naively be encoded to \xe2\x82\xac. This will likely be a one-way operation as decoding it again would be tricky.

Not working ST3 3126

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/opt/sublime_text/sublime_plugin.py", line 915, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "sublime_codec in /home/avasilev/.config/sublime-text-3/Installed Packages/Codec.sublime-package", line 11, in <module>
ImportError: cannot import name parse

platform: ubuntu 16.04 lts

PLEASE FIX IT!!! <3

Some Base64 encoded content without padding fails to be decoded

Hello,

Some Base64 content without padding like eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ is not able to decode. Such data can be decoded: eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ==.

In the console I'm getting those messages:

Codec: fix base32 padding? False
Codec: fix base64 padding? False
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1488, in run_
    return self.run(edit, **args)
  File "/Users/abc/Library/Application Support/Sublime Text 3/Installed Packages/Codec.sublime-package/sublime_codec.py", line 78, in run
  File "/Users/abc/Library/Application Support/Sublime Text 3/Installed Packages/Codec.sublime-package/codec_base64.py", line 10, in b64decode
  File "./python3.3/base64.py", line 91, in b64decode
binascii.Error: Incorrect padding

RIPEMD

ripemd128, ripemd160, ripemd256, ripemd320

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.