Skip to content

Instantly share code, notes, and snippets.

View emberian's full-sized avatar

emberian

View GitHub Profile
iOXoParereaRing
this
in
english
the
nXoParereaR
ing
the
ZlainteEtoO
the
GOXJPTMFMFTRGUICNGYGUFUIBGYNCN
FUXJPTMFMFTRGUICNFZBTGUCFECJOC
NFOGMYCTYYGIUQFUCGUJPMLMXZCJIM
TZNXLJPMYFCNGYTYYGIUQFUCWTYYPZ
ZJYFRBXZJYCFRCWJRTXYHFOJMFCNFF
URJOCNFFGINCNQJUCNGUCNFXFTMJOC
WFUCXOJPMCFFUTYXJPNTSFRGYLJSFM
FRHXLMTLVGUICNGYTYYGIUQFUCGCWT
YFULMXZCFRPYGUITYGQZBFQJUJTBZN
THFCGLYPHYCGCPCGJULGZNFMOJMCNG

A dirt-simple brute forcer for my crypto assignment, using a monoalphabetic cipher.

#![feature(unsafe_destructor)]
use std::rc::Rc;
use std::cell::RefCell;
struct Handle1 {
val: u32
}
// note that moving det after makes it 24 bytes instead of 16, for alignment!
Rust's lexical grammar is not context-free. Raw string literals are the source
of the problem. Informally, a raw string literal is an `r`, followed by `N`
hashes (where N can be zero), a quote, any characters, then a quote followed
by `N` hashes. This grammar describes this as best possible:
R -> 'r' S
S -> '"' B '"'
S -> '#' S '#'
B -> . B
B -> ε
trait Iterator<T> {
fn next(&mut self) -> Option<T>;
}
impl Iterator<uint> for uint {
fn next(&mut self) -> Option<uint> {
if *self == 0 { None }
else { *self -= 1; Some(*self) }
}
}
fragment LIT_STR_RAW_INNER
: POUND LIT_STR_RAW_INNER2 POUND
;
fragment LIT_STR_RAW_INNER2
: LIT_STR_RAW_INNER
| '"' .*? '"'
;
LIT_STR_RAW
layout title date comments categories
post
This Week in Rust
2014-04-26 14:06
true
rust programming this-week-in-rust

Hello and welcome to another issue of This Week in Rust!

#[no_uv];
extern crate native;
extern crate gl;
extern crate hgl;
extern crate png;
extern crate glfw = "glfw-rs";
use std::mem::size_of;