ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
lanodan has joined #crystal-lang
ur5us has joined #crystal-lang
notzmv has joined #crystal-lang
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 250 seconds]
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #crystal-lang
<frojnd> Hi there.
<frojnd> I'm trying to use MD5 function for a file that I just uploaded to the server
<Sankalp> Hello
<frojnd> Not sure how can I perform this with crystal lang
<Sankalp> Perhaps something like this: Digest::MD5.digest
<frojnd> Thank you
jmdaemon has quit [Ping timeout: 246 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 260 seconds]
<FromGitter> <Blacksmoke16> frojnd: `Digest::MD5.digest &.file(file_path)`
<frojnd> @Blacksmoke16 yes, it prints in bytes e.g.: => Bytes[60, 215, 160, 219, 118, 255, 157, 202, 72, 151, 158, 36, 195, 155, 64, 140] I need hex, so Digest::MD5.hexdigest(file) prints in hex: "3cd7a0db76ff9dca48979e24c39b408c"
<frojnd> Or just: Digest::MD5.hexdigest &.file("./bla.txt")
<frojnd> What's called &. after hexdigest?
<FromGitter> <Blacksmoke16> its the same as like `Digest::MD5.hexdigest { |ctx| ctx.file "./bla.txt" }`
<frojnd> Ok
<frojnd> What's this called? Semanticlly?
<frojnd> s/Semantically/semantically
<frojnd> Ah blocks and procs
<frojnd> While I'm here, What's the meaning of `::` e.g. inside `Digest::MD5`
<frojnd> It says: Class `Digest::MD5`
<FromGitter> <Blacksmoke16> i dont think its ever explicitly called out anywhere, but its the same as ruby
<FromGitter> <Blacksmoke16> tl;dr its the namespace separator. E.g.
<frojnd> Thank you
sorcus has quit [Quit: WeeChat 3.5]
jmdaemon has joined #crystal-lang
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #crystal-lang
sorcus has joined #crystal-lang
<FromGitter> <vgramkris> hi, is there any ways to check if a channel is empty w/o calling receive?
<FromGitter> <wrq> ⏎ ⏎ with large enums, should crystal have a cap on trying to expand cases for exhaustive case?
<FromGitter> <wrq> It's trying to enumerate 308915776 cases here, just as an example
<FromGitter> <Blacksmoke16> @vgramkris i dont think there is. But could probably use `select` to handle the case where there is no value ready to be consumed. E.g.
notzmv has joined #crystal-lang
<FromGitter> <vgramkris> thanks George, let me check that
notzmv has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
wolfshappen has quit [Quit: later]
wolfshappen has joined #crystal-lang