Ruby循环顺序? [英] Ruby loop order?

查看:176
本文介绍了Ruby循环顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图强制一个密码。当我玩了一些循环,我注意到有一个特定的顺序。比如,如果我有 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).

http://www.asciitable.com/

Other encoding standards exist, like EBCDIC which is used by IBM mid-range computers.

这篇关于Ruby循环顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆