Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-sshkey
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ac5412d
authored
Jul 02, 2014
by
Scott Duckworth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use binascii.hexlify() in bytes2int()
parent
fa9b8154
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
django_sshkey/util.py
+2
-6
No files found.
django_sshkey/util.py
View file @
6ac5412d
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import
base64
import
base64
import
binascii
import
struct
import
struct
SSHKEY_LOOKUP_URL_DEFAULT
=
'http://localhost:8000/sshkey/lookup'
SSHKEY_LOOKUP_URL_DEFAULT
=
'http://localhost:8000/sshkey/lookup'
...
@@ -52,13 +53,8 @@ def wrap(text, width, wrap_end=None):
...
@@ -52,13 +53,8 @@ def wrap(text, width, wrap_end=None):
n
=
m
n
=
m
return
t
return
t
def
bin2hex
(
data
):
return
''
.
join
(
'
%02
x'
%
struct
.
unpack
(
'B'
,
b
)
for
b
in
data
)
hex2bin
=
bytearray
.
fromhex
def
bytes2int
(
b
):
def
bytes2int
(
b
):
h
=
''
.
join
(
'
%02
x'
%
struct
.
unpack
(
'B'
,
x
)
for
x
in
b
)
h
=
binascii
.
hexlify
(
b
)
return
int
(
h
,
16
)
return
int
(
h
,
16
)
def
int2bytes
(
i
):
def
int2bytes
(
i
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment