Ruby循环顺序? [英] Ruby loop order?
问题描述
for'。''。'〜'
它会放入 。
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
$ b 在看完这些之后,我想知道什么是Ruby中的循环顺序?哪个字符是最高优先级,哪个字符是最低优先级?很抱歉如果这个问题是基本的。我只是没有找到任何人都知道的网站。如果您对这个问题有疑问,可以问一下。我希望这已经足够清楚了!
解决方案顺序是由字母的二进制表示定义的。而这又是由一个标准定义的。使用的标准是ASCII(美国信息交换标准代码)。
>
I'm trying to bruteforce a password. As I was playing with some loops, I've noticed there's a specific order. Like, if I have for i in '.'..'~'
it puts
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
After seeing this, I wondered to myself "what is the loop order in Ruby?" What character is the highest priority and which is the lowest priority? Sorry if this question is basic. I just haven't found a site where anyone knows. If you have questions about the question just ask. I hope this is clear enough!
解决方案 The order is defined by the binary representation of the letters. Which, in turn, is defined by a standard. The standard used is ASCII (American Standard Code for Information Interchange).
Other encoding standards exist, like EBCDIC which is used by IBM mid-range computers.
这篇关于Ruby循环顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!