Email or username:

Password:

Forgot your password?
ari :prideified:

Just python being sus:

>>> chr(sum(range(ord(min(str(not()))))))
'ඞ'
13 comments
Haelwenn /элвэн/ :triskell:
@ar Really reminds me of the obfuscation Perl allows to do.
ari :prideified:

also, i didn't "invent" it; I stole it from a screenshot of a twitter post i saw elsewhere

screenshot of two twitter posts:

user @chordbug: participating in a python ctf this weekend and our team name is chr(sum(range(ord(min(str(not()))))))

reply from user @0x466161: Bro what the actual fuck lmao
and with screenshot of the output of the line above, with the glyph ඞ resembling a character from the game Among Us
:neocat_flag_nb: Mira ✨

@ar This is brilliant. I marvel at the kind of brain that figured this out.

metatablecat :verifiedenby: :verifiedaroace: :neocat_floof_cute:

@ar i decided lets do this in lua

utf8.char((function(x,y)return((x/2)*y)end)(string.byte(string.match(string.upper(type(_VERSION)),".."),1,2)))

smallest i was able to achieve

if you exclude the string. and utf8. calls:

char((function(x,y)return((x/2)*y)end)(byte(match(upper(type(_VERSION)),".."),1,2)))

metatablecat :verifiedenby: :verifiedaroace: :neocat_floof_cute:

@ar ok i lied, heres a MUCH smaller statement

=(function(a,b)c=a.byte(a.upper(type(a)))return b.char((c-1)/2*c)end)(string,utf8)

the = is an alias for print

Christmas Tree

@ar my first thought was "`not` isn't a function so that's a syntax error" but then realized it was performing `not` on an empty tuple 💀

Cysio :verified_gay:​

@ar it was interesting to deconstruct it, how this works

sleepy lesbian
@ar It takes the boolean True
Turns it into a string, so 'True'
Gets the character with the lowest encoding value, which would be 'T' since it's the only capital letter
Gets the encoding value of it, so 0x54 or 84
Makes it a range from 0 to that number, so 0 to 84
Sums all numbers from 0 to 84, which is 3486
And that happens to be the value for the character ඞ

Insane
@ar It takes the boolean True
Turns it into a string, so 'True'
Gets the character with the lowest encoding value, which would be 'T' since it's the only capital letter
ari :prideified:

Just ruby being sus:

irb(main):021> [(1...(not()).class.to_s.split(//).first.ord).sum].pack("U")
=> "ඞ"
ari :prideified:

Sadly, ruby doesn't allow .chr on ints bigger than 255, which is why i had to use .pack()

irb(main):023> [(1...(not()).class.to_s.split(//).first.ord).sum].pack("U").ord
=> 3486
irb(main):024> [(1...(not()).class.to_s.split(//).first.ord).sum].pack("U").ord.chr
(irb):24:in `chr': 3486 out of char range (RangeError)
from (irb):24:in `<main>'
from /nix/store/vdgv5dakkng4mgyyk4xqh32z4mmy8gaw-ruby3.1-irb-1.12.0/lib/ruby/gems/3.1.0/gems/irb-1.12.0/exe/irb:9:in `<top (required)>'
from /nix/store/vdgv5dakkng4mgyyk4xqh32z4mmy8gaw-ruby3.1-irb-1.12.0/bin/irb:18:in `load'
from /nix/store/vdgv5dakkng4mgyyk4xqh32z4mmy8gaw-ruby3.1-irb-1.12.0/bin/irb:18:in `<main>'

Sadly, ruby doesn't allow .chr on ints bigger than 255, which is why i had to use .pack()

irb(main):023> [(1...(not()).class.to_s.split(//).first.ord).sum].pack("U").ord
=> 3486
irb(main):024> [(1...(not()).class.to_s.split(//).first.ord).sum].pack("U").ord.chr
(irb):24:in `chr': 3486 out of char range (RangeError)
from (irb):24:in `<main>'
from /nix/store/vdgv5dakkng4mgyyk4xqh32z4mmy8gaw-ruby3.1-irb-1.12.0/lib/ruby/gems/3.1.0/gems/irb-1.12.0/exe/irb:9:in `<top (required)>'
from /nix/store/vdgv5dakkng4mgyyk4xqh32z4mmy...
Skelozard

@ar@is-a.cat Just Haskell being sus

ghci> putStrLn [chr $ sum [0..ord (minimum (show (not False))) - 1]]
ඞ

Go Up