Created
September 25, 2014 20:59
-
-
Save fabiomontefuscolo/44c55925cc39690cdb72 to your computer and use it in GitHub Desktop.
Sublime3 command that replace selected strings by their md5 hashes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import hashlib | |
import sublime | |
import sublime_plugin | |
class Md5fyCommand(sublime_plugin.TextCommand): | |
def run(self, edit, *args): | |
for region in self.view.sel(): | |
if not region.empty(): | |
s = self.view.substr(region) | |
s = s.encode('utf-8') | |
s = hashlib.md5(s).hexdigest() | |
self.view.replace(edit, region, s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this on ~/.config/sublime-text-3/Packages/User/md5fy.py