1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 var xor_base
= b
"qwertyuiopasdfghjklzxcvbnm"
18 var xor_base_2
= xor_base
.clone
19 var xor_base_3
= xor_base
.clone
23 var key_cstr
= key
.items
24 var xb_cstr
= xor_base
.items
26 xb_cstr
.xor
(key_cstr
, 5, 1)
28 print xb_cstr
.to_s_with_length
(xor_base
.length
)
30 xb_cstr
.xor
(key_cstr
, xor_base
.length
, 1)
32 print xb_cstr
.to_s_with_length
(xor_base
.length
)
34 var xb_cstr2
= xor_base_2
.items
35 var xb_cstr3
= xor_base_3
.items
36 var key2_cstr
= key2
.items
38 xb_cstr2
.xor
(key2_cstr
, xor_base_2
.length
, 2, 1)
40 xb_cstr3
.xor
(key2_cstr
, xor_base_3
.length
, 2)
42 print xb_cstr2
.to_s_with_length
(xor_base_2
.length
)
43 print xb_cstr3
.to_s_with_length
(xor_base_3
.length
)