Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
ee04c6ff
Commit
ee04c6ff
authored
May 02, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added string conversion API
* bin * pad * unpad * conversion bin/hex/dec
parent
5a692b9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
2 deletions
+61
-2
ethereum.js
ethereal/assets/ethereum.js
+58
-1
webapp.qml
ethereal/assets/qml/webapp.qml
+2
-0
samplecoin.html
ethereal/assets/samplecoin/samplecoin.html
+1
-1
No files found.
ethereal/assets/ethereum.js
View file @
ee04c6ff
...
@@ -114,7 +114,7 @@ function debug(/**/) {
...
@@ -114,7 +114,7 @@ function debug(/**/) {
var
args
=
arguments
;
var
args
=
arguments
;
var
msg
=
""
var
msg
=
""
for
(
var
i
=
0
;
i
<
args
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
args
.
length
;
i
++
){
if
(
typeof
args
[
i
]
==
"object"
)
{
if
(
typeof
args
[
i
]
==
=
"object"
)
{
msg
+=
" "
+
JSON
.
stringify
(
args
[
i
])
msg
+=
" "
+
JSON
.
stringify
(
args
[
i
])
}
else
{
}
else
{
msg
+=
args
[
i
]
msg
+=
args
[
i
]
...
@@ -155,3 +155,60 @@ navigator.qt.onmessage = function(ev) {
...
@@ -155,3 +155,60 @@ navigator.qt.onmessage = function(ev) {
}
}
}
}
}
}
window
.
eth
.
_0
=
"
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0"
String
.
prototype
.
pad
=
function
(
len
)
{
var
bin
=
this
.
bin
();
var
l
=
bin
.
length
;
if
(
l
<
32
)
{
return
eth
.
_0
.
substr
(
0
,
32
-
bin
.
length
)
+
bin
;
}
return
bin
;
}
String
.
prototype
.
unpad
=
function
()
{
var
i
,
l
;
for
(
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
)
{
if
(
this
[
i
]
!=
"
\
0"
)
{
return
this
.
substr
(
i
,
this
.
length
);
}
}
return
this
.
substr
(
i
,
this
.
length
);
}
String
.
prototype
.
bin
=
function
()
{
if
(
this
.
substr
(
0
,
2
)
==
"0x"
)
{
return
this
.
hex2bin
();
}
else
if
(
/^
\d
+$/
.
test
(
this
))
{
return
this
.
num2bin
()
}
// Otherwise we'll return the "String" object instead of an actual string
return
this
.
substr
(
0
,
this
.
length
)
}
String
.
prototype
.
unbin
=
function
()
{
var
i
,
l
,
o
=
''
;
for
(
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
)
{
var
n
=
this
.
charCodeAt
(
i
).
toString
(
16
);
o
+=
n
.
length
<
2
?
'0'
+
n
:
n
;
}
return
"0x"
+
o
;
}
String
.
prototype
.
hex2bin
=
function
()
{
bytes
=
[]
for
(
var
i
=
2
;
i
<
this
.
length
-
1
;
i
+=
2
){
bytes
.
push
(
parseInt
(
this
.
substr
(
i
,
2
),
16
));
}
return
String
.
fromCharCode
.
apply
(
String
,
bytes
);
}
String
.
prototype
.
num2bin
=
function
()
{
return
(
"0x"
+
parseInt
(
this
).
toString
(
16
)).
bin
()
}
ethereal/assets/qml/webapp.qml
View file @
ee04c6ff
...
@@ -123,6 +123,8 @@ ApplicationWindow {
...
@@ -123,6 +123,8 @@ ApplicationWindow {
function
onObjectChangeCb
(
stateObject
)
{
function
onObjectChangeCb
(
stateObject
)
{
postEvent
(
"object:"
+
stateObject
.
address
(),
stateObject
)
postEvent
(
"object:"
+
stateObject
.
address
(),
stateObject
)
}
}
function
onStorageChangeCb
()
{
}
}
}
Rectangle
{
Rectangle
{
...
...
ethereal/assets/samplecoin/samplecoin.html
View file @
ee04c6ff
...
@@ -21,7 +21,7 @@ function createTransaction() {
...
@@ -21,7 +21,7 @@ function createTransaction() {
}
}
function
init
()
{
function
init
()
{
eth
.
set
({
width
:
500
,
title
:
"Hello world"
})
eth
.
set
({
width
:
500
})
eth
.
getKey
(
function
(
key
)
{
eth
.
getKey
(
function
(
key
)
{
eth
.
getStorageAt
(
jefcoinAddr
,
key
,
function
(
storage
)
{
eth
.
getStorageAt
(
jefcoinAddr
,
key
,
function
(
storage
)
{
...
...
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