repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/wallet.rs
frostsnap_coordinator/src/bitcoin/wallet.rs
use super::{chain_sync::ChainClient, multi_x_descriptor_for_account}; use crate::persist::Persisted; use anyhow::{anyhow, Context, Result}; use bdk_chain::{ bitcoin::{self, bip32, Amount, BlockHash, OutPoint, ScriptBuf, TxOut, Txid}, indexed_tx_graph::{self}, indexer::keychain_txout::{self, KeychainTxOutIndex}, local_chain, miniscript::{Descriptor, DescriptorPublicKey}, CanonicalizationParams, ChainPosition, CheckPoint, ConfirmationBlockTime, Indexer, Merge, }; use frostsnap_core::{ bitcoin_transaction::{self, LocalSpk}, tweak::{AppTweakKind, BitcoinAccountKeychain, BitcoinBip32Path}, MasterAppkey, }; use frostsnap_core::{ bitcoin_transaction::{PushInput, TransactionTemplate}, tweak::BitcoinAccount, }; use std::{ collections::{HashMap, HashSet}, ops::RangeBounds, str::FromStr, sync::{Arc, Mutex}, }; use tracing::{event, Level}; pub type KeychainId = (MasterAppkey, BitcoinAccountKeychain); pub type WalletIndexer = KeychainTxOutIndex<KeychainId>; pub type WalletIndexedTxGraph = indexed_tx_graph::IndexedTxGraph<ConfirmationBlockTime, WalletIndexer>; pub type WalletIndexedTxGraphChangeSet = indexed_tx_graph::ChangeSet<ConfirmationBlockTime, keychain_txout::ChangeSet>; /// Wallet that manages all the frostsnap keys on the same network in a single transaction graph pub struct CoordSuperWallet { tx_graph: Persisted<WalletIndexedTxGraph>, chain: Persisted<local_chain::LocalChain>, chain_client: ChainClient, pub network: bitcoin::Network, db: Arc<Mutex<rusqlite::Connection>>, } impl CoordSuperWallet { pub fn load_or_init( db: Arc<Mutex<rusqlite::Connection>>, network: bitcoin::Network, chain_client: ChainClient, ) -> anyhow::Result<Self> { event!( Level::INFO, network = network.to_string(), "initializing super wallet" ); let mut db_ = db.lock().unwrap(); let tx_graph = Persisted::new(&mut *db_, ()).context("loading transaction from the database")?; let chain = Persisted::new( &mut *db_, bitcoin::constants::genesis_block(network).block_hash(), ) .context("loading chain from database")?; drop(db_); Ok(Self { tx_graph, chain, chain_client, db, network, }) } /// Get the local chain tip. pub fn chain_tip(&self) -> CheckPoint { self.chain.tip() } /// Transaction cache for the chain client. pub fn tx_cache(&self) -> impl Iterator<Item = (Txid, Arc<bitcoin::Transaction>)> + '_ { self.tx_graph .graph() .full_txs() .map(|tx_node| (tx_node.txid, tx_node.tx)) } pub fn anchor_cache( &self, ) -> impl Iterator<Item = ((Txid, BlockHash), ConfirmationBlockTime)> + '_ { self.tx_graph .graph() .all_anchors() .iter() .flat_map(|(&txid, anchors)| { anchors .iter() .map(move |&anchor| ((txid, anchor.block_id.hash), anchor)) }) } pub fn lookahead(&self) -> u32 { self.tx_graph.index.lookahead() } pub fn get_tx(&self, txid: Txid) -> Option<Arc<bitcoin::Transaction>> { self.tx_graph.graph().get_tx(txid) } pub fn get_txout(&self, outpoint: OutPoint) -> Option<bitcoin::TxOut> { self.tx_graph.graph().get_txout(outpoint).cloned() } pub fn get_prevouts( &self, outpoints: impl Iterator<Item = OutPoint>, ) -> HashMap<OutPoint, TxOut> { outpoints .into_iter() .filter_map(|op| Some((op, self.get_txout(op)?))) .collect() } pub fn is_spk_mine(&self, master_appkey: MasterAppkey, spk: ScriptBuf) -> bool { self.tx_graph .index .index_of_spk(spk) .is_some_and(|((key, _), _)| *key == master_appkey) } fn descriptors_for_key( approot: MasterAppkey, network: bitcoin::NetworkKind, ) -> Vec<(BitcoinAccountKeychain, Descriptor<DescriptorPublicKey>)> { [ BitcoinAccountKeychain::external(), BitcoinAccountKeychain::internal(), ] .into_iter() .zip( //XXX: this logic is very brittle and implicit with respect to accounts super::multi_x_descriptor_for_account(approot, BitcoinAccount::default(), network) .into_single_descriptors() .expect("should be well formed"), ) .collect() } fn lazily_initialize_key(&mut self, master_appkey: MasterAppkey) { if self .tx_graph .index .get_descriptor((master_appkey, BitcoinAccountKeychain::external())) .is_none() { for (account_keychain, descriptor) in Self::descriptors_for_key(master_appkey, self.network.into()) { let keychain_id = (master_appkey, account_keychain); self.tx_graph .MUTATE_NO_PERSIST() .index .insert_descriptor(keychain_id, descriptor) .expect("two keychains must not have the same spks"); let lookahead = self.lookahead(); let next_index = self .tx_graph .index .last_revealed_index(keychain_id) .map_or(lookahead, |lr| lr + lookahead + 1); self.chain_client.monitor_keychain(keychain_id, next_index); } let all_txs = self .tx_graph .graph() .full_txs() .map(|tx| tx.tx.clone()) .collect::<Vec<_>>(); // FIXME: This should be done by BDK automatically in a version soon. // FIXME: We want a high enough last-derived-index before doing indexing otherwise we // may misindex some txs. for tx in &all_txs { let _ = self.tx_graph.MUTATE_NO_PERSIST().index.index_tx(tx); } } } pub fn list_addresses(&mut self, master_appkey: MasterAppkey) -> Vec<AddressInfo> { self.lazily_initialize_key(master_appkey); let keychain = BitcoinAccountKeychain::external(); let (final_address_index, _) = self .tx_graph .index .next_index((master_appkey, keychain)) .expect("keychain exists"); (0..=final_address_index) .rev() .map(|i| { self.address_info( master_appkey, BitcoinBip32Path { account_keychain: keychain, index: i, }, ) }) .collect() } pub fn address(&mut self, master_appkey: MasterAppkey, index: u32) -> Option<AddressInfo> { self.lazily_initialize_key(master_appkey); let keychain = BitcoinAccountKeychain::external(); Some(self.address_info( master_appkey, BitcoinBip32Path { account_keychain: keychain, index, }, )) } fn address_info(&self, master_appkey: MasterAppkey, path: BitcoinBip32Path) -> AddressInfo { let keychain = (master_appkey, path.account_keychain); let used = self.tx_graph.index.is_used(keychain, path.index); let revealed = self.tx_graph.index.last_revealed_index(keychain) <= Some(path.index); let spk = super::peek_spk(master_appkey, path); AddressInfo { index: path.index, address: bitcoin::Address::from_script(&spk, self.network).expect("has address form"), external: true, used, revealed, derivation_path: path.path_segments_from_bitcoin_appkey().collect(), } } pub fn next_address(&mut self, master_appkey: MasterAppkey) -> AddressInfo { self.lazily_initialize_key(master_appkey); let keychain = BitcoinAccountKeychain::external(); let (index, _) = self .tx_graph .index .next_index((master_appkey, keychain)) .expect("keychain exists"); self.address_info( master_appkey, BitcoinBip32Path { account_keychain: keychain, index, }, ) } pub fn mark_address_shared( &mut self, master_appkey: MasterAppkey, derivation_index: u32, ) -> Result<bool> { self.lazily_initialize_key(master_appkey); let keychain = BitcoinAccountKeychain::external(); let mut db = self.db.lock().unwrap(); self.tx_graph.mutate(&mut db, |tx_graph| { let (_, changeset) = tx_graph .index .reveal_to_target((master_appkey, keychain), derivation_index) .ok_or(anyhow!("keychain doesn't exist"))?; Ok((changeset.is_empty(), changeset)) }) } pub fn search_for_address( &self, master_appkey: MasterAppkey, address_str: String, start: u32, stop: u32, ) -> Option<AddressInfo> { let account_descriptors = multi_x_descriptor_for_account( master_appkey, BitcoinAccount::default(), self.network.into(), ) .into_single_descriptors() .ok()?; let target_address = bitcoin::Address::from_str(&address_str) .ok()? .require_network(self.network) .ok()?; let found_address_derivation = { (start..stop).find_map(|i| { account_descriptors.iter().find_map(|descriptor| { let derived = descriptor.at_derivation_index(i).ok()?; let address = derived.address(self.network).ok()?; if address == target_address { // FIXME: this should get the derivation path from the descriptor itself let external = account_descriptors[0] == *descriptor; let keychain = if external { BitcoinAccountKeychain::external() } else { BitcoinAccountKeychain::internal() }; Some(self.address_info( master_appkey, BitcoinBip32Path { account_keychain: keychain, index: i, }, )) } else { None } }) }) }; found_address_derivation } pub fn list_transactions(&mut self, master_appkey: MasterAppkey) -> Vec<Transaction> { self.lazily_initialize_key(master_appkey); let mut txs = self .tx_graph .graph() .list_canonical_txs( self.chain.as_ref(), self.chain.tip().block_id(), CanonicalizationParams::default(), ) .collect::<Vec<_>>(); txs.sort_unstable_by_key(|tx| core::cmp::Reverse(tx.chain_position)); txs.into_iter() .filter_map(|canonical_tx| { let inner = canonical_tx.tx_node.tx.clone(); let txid = canonical_tx.tx_node.txid; let confirmation_time = match canonical_tx.chain_position { ChainPosition::Confirmed { anchor, .. } => Some(ConfirmationTime { height: anchor.block_id.height, time: anchor.confirmation_time, }), _ => None, }; let last_seen = canonical_tx.tx_node.last_seen; let prevouts = self.get_prevouts(inner.input.iter().map(|txin| txin.previous_output)); let is_mine = inner .output .iter() .chain(prevouts.values()) .map(|txout| txout.script_pubkey.clone()) .filter(|spk| self.is_spk_mine(master_appkey, spk.clone())) .collect::<HashSet<ScriptBuf>>(); if is_mine.is_empty() { None } else { Some(Transaction { inner, txid, confirmation_time, last_seen, prevouts, is_mine, }) } }) .collect() } pub fn apply_update( &mut self, update: bdk_electrum_streaming::Update<KeychainId>, ) -> Result<bool> { let mut db = self.db.lock().unwrap(); let changed = self .tx_graph .multi(&mut self.chain) .mutate(&mut db, |tx_graph, chain| { let chain_changeset = match update.chain_update { Some(update) => chain.apply_update(update)?, None => local_chain::ChangeSet::default(), }; let indexer_changeset = tx_graph .index .reveal_to_target_multi(&update.last_active_indices); let tx_changeset = tx_graph.apply_update(update.tx_update); let changed = !(chain_changeset.is_empty() && indexer_changeset.is_empty() && tx_changeset.is_empty()); Ok((changed, (tx_changeset, chain_changeset))) })?; Ok(changed) } pub fn reconnect(&mut self) { self.chain_client.reconnect() } pub fn send_to( &mut self, master_appkey: MasterAppkey, recipients: impl IntoIterator<Item = (bitcoin::Address, Option<u64>)>, feerate: f32, ) -> Result<bitcoin_transaction::TransactionTemplate> { self.lazily_initialize_key(master_appkey); use bdk_coin_select::{ metrics, Candidate, ChangePolicy, CoinSelector, DrainWeights, FeeRate, Target, TargetFee, TargetOutputs, TR_DUST_RELAY_MIN_VALUE, TR_KEYSPEND_TXIN_WEIGHT, }; let recipients = recipients.into_iter().collect::<Vec<_>>(); let target_outputs = { let mut target_outputs = Vec::<bitcoin::TxOut>::with_capacity(recipients.len()); let mut available_amount = self.calculate_avaliable_value( master_appkey, recipients.iter().map(|(addr, _)| addr.clone()), feerate, true, ); for (i, (addr, amount_opt)) in recipients.iter().enumerate() { let amount: u64 = match amount_opt { Some(amount) => *amount, None => available_amount .try_into() .map_err(|_| anyhow!("insufficient balance"))?, }; available_amount = available_amount .checked_sub_unsigned(amount) .expect("specified recipient amount is overly large"); if available_amount < 0 { return Err(anyhow!( "Insufficient balance: {available_amount}sats left for recipient {i}" )); } target_outputs.push(TxOut { value: Amount::from_sat(amount), script_pubkey: addr.script_pubkey(), }); } target_outputs }; let utxos: Vec<(_, bdk_chain::FullTxOut<_>)> = self .tx_graph .graph() .filter_chain_unspents( self.chain.as_ref(), self.chain.tip().block_id(), CanonicalizationParams::default(), self.tx_graph .index .keychain_outpoints_in_range(Self::key_index_range(master_appkey)), ) .collect(); let candidates = utxos .iter() .map(|(_path, utxo)| Candidate { input_count: 1, value: utxo.txout.value.to_sat(), weight: TR_KEYSPEND_TXIN_WEIGHT, is_segwit: true, }) .collect::<Vec<_>>(); let target = Target { fee: TargetFee::from_feerate(FeeRate::from_sat_per_vb(feerate)), outputs: TargetOutputs::fund_outputs( target_outputs .iter() .map(|txo| (txo.weight().to_wu(), txo.value.to_sat())), ), }; // we try and guess the usual feerate from the existing transactions in the graph This is // not a great heuristic since it doesn't focus on transactions the user has sent recently. let long_term_feerate_guess = { let feerates = self .tx_graph .graph() .full_txs() .filter_map(|tx| { Some( self.tx_graph.graph().calculate_fee(&tx).ok()?.to_sat() as f32 / tx.weight().to_wu() as f32, ) }) .collect::<Vec<_>>(); let mut average = feerates.iter().sum::<f32>() / feerates.len() as f32; if !average.is_normal() { average = 10.0; } FeeRate::from_sat_per_vb(average) }; let drain_weights = DrainWeights::TR_KEYSPEND; let change_policy = ChangePolicy::min_value_and_waste( drain_weights, TR_DUST_RELAY_MIN_VALUE, target.fee.rate, long_term_feerate_guess, ); let mut cs = CoinSelector::new(&candidates); let metric = metrics::LowestFee { target, long_term_feerate: long_term_feerate_guess, change_policy, }; match cs.run_bnb(metric, 500_000) { Err(_) => { event!(Level::ERROR, "unable to find a selection with lowest fee"); cs.select_until_target_met(target)?; } Ok(score) => { event!(Level::INFO, "coin selection succeeded with score: {score}"); } } let selected_utxos = cs.apply_selection(&utxos); let mut template_tx = frostsnap_core::bitcoin_transaction::TransactionTemplate::new(); for (((_master_appkey, account_keychain), index), selected_utxo) in selected_utxos { assert_eq!(_master_appkey, &master_appkey); let prev_tx = self .tx_graph .graph() .get_tx(selected_utxo.outpoint.txid) .expect("must exist"); let bip32_path = BitcoinBip32Path { account_keychain: *account_keychain, index: *index, }; template_tx .push_owned_input( PushInput::spend_tx_output(prev_tx.as_ref(), selected_utxo.outpoint.vout), LocalSpk { master_appkey, bip32_path, }, ) .expect("must be able to add input"); } if let Some(value) = cs.drain_value(target, change_policy) { let mut db = self.db.lock().unwrap(); let (i, _change_spk) = self.tx_graph.mutate(&mut *db, |tx_graph| { Ok(tx_graph .index .next_unused_spk((master_appkey, BitcoinAccountKeychain::internal())) .expect( "this should have been initialzed by now since we are spending from it", )) })?; self.tx_graph .MUTATE_NO_PERSIST() .index .mark_used((master_appkey, BitcoinAccountKeychain::internal()), i); template_tx.push_owned_output( Amount::from_sat(value), LocalSpk { master_appkey, bip32_path: BitcoinBip32Path { account_keychain: BitcoinAccountKeychain::internal(), index: i, }, }, ); } for txo in target_outputs { template_tx.push_foreign_output(txo); } Ok(template_tx) } pub fn calculate_avaliable_value( &mut self, master_appkey: MasterAppkey, target_addresses: impl IntoIterator<Item = bitcoin::Address>, feerate: f32, effective_only: bool, ) -> i64 { self.lazily_initialize_key(master_appkey); use bdk_coin_select::{ Candidate, CoinSelector, Drain, FeeRate, Target, TargetFee, TargetOutputs, TR_KEYSPEND_TXIN_WEIGHT, }; let feerate = FeeRate::from_sat_per_vb(feerate); let target = Target { fee: TargetFee::from_feerate(feerate), outputs: TargetOutputs::fund_outputs(target_addresses.into_iter().map(|addr| { let txo = bitcoin::TxOut { script_pubkey: addr.script_pubkey(), value: Amount::ZERO, }; (txo.weight().to_wu(), 0) })), }; let candidates = self .tx_graph .graph() .filter_chain_unspents( self.chain.as_ref(), self.chain.tip().block_id(), CanonicalizationParams::default(), self.tx_graph .index .keychain_outpoints_in_range(Self::key_index_range(master_appkey)), ) .map(|(_path, utxo)| Candidate { input_count: 1, value: utxo.txout.value.to_sat(), weight: TR_KEYSPEND_TXIN_WEIGHT, is_segwit: true, }) .collect::<Vec<_>>(); let mut cs = CoinSelector::new(&candidates); if effective_only { cs.select_all_effective(feerate); } else { cs.select_all(); } cs.excess(target, Drain::NONE) } fn key_index_range( master_appkey: MasterAppkey, ) -> impl RangeBounds<(MasterAppkey, BitcoinAccountKeychain)> { (master_appkey, BitcoinAccountKeychain::external()) ..=(master_appkey, BitcoinAccountKeychain::internal()) } pub fn fee(&self, tx: &bitcoin::Transaction) -> Result<u64> { let fee = self.tx_graph.graph().calculate_fee(tx)?; Ok(fee.to_sat()) } pub fn broadcast_success(&mut self, tx: bitcoin::Transaction) { // We do our best here, if it fails to persist we should recover from this eventually let res = self .tx_graph .mutate(&mut *self.db.lock().unwrap(), |tx_graph| { let mut changeset = tx_graph.insert_seen_at( tx.compute_txid(), std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() .as_secs(), ); changeset.merge(tx_graph.insert_tx(tx)); Ok(((), changeset)) }); if let Err(e) = res { event!( Level::ERROR, error = e.to_string(), "failed to persist broadcast" ); } } pub fn psbt_to_tx_template( &mut self, psbt: &bitcoin::Psbt, master_appkey: MasterAppkey, ) -> Result<TransactionTemplate, PsbtValidationError> { let bitcoin_app_xpub = master_appkey.derive_appkey(AppTweakKind::Bitcoin); let our_fingerprint = bitcoin_app_xpub.fingerprint(); let mut template = frostsnap_core::bitcoin_transaction::TransactionTemplate::new(); let rust_bitcoin_tx = &psbt.unsigned_tx; template.set_version(rust_bitcoin_tx.version); template.set_lock_time(rust_bitcoin_tx.lock_time); let mut already_signed_count = 0; let mut foreign_count = 0; let mut owned_count = 0; for (i, input) in psbt.inputs.iter().enumerate() { let txin = rust_bitcoin_tx .input .get(i) .ok_or(anyhow!("PSBT input {i} is malformed"))?; let txout = input .witness_utxo .as_ref() .or_else(|| { let tx = input.non_witness_utxo.as_ref()?; tx.output.get(txin.previous_output.vout as usize) }) .ok_or(anyhow!( "PSBT input {i} missing witness and non-witness utxo" ))?; let input_push = PushInput::spend_outpoint(txout, txin.previous_output).with_sequence(txin.sequence); macro_rules! bail { ($category:ident, $($reason:tt)*) => {{ event!( Level::INFO, "Skipping signing PSBT input {i} because it {}", $($reason)* ); $category += 1; template.push_foreign_input(input_push); continue; }}; } if input.final_script_witness.is_some() { bail!( already_signed_count, "it already has a final_script_witness" ); } let tap_internal_key = match &input.tap_internal_key { Some(tap_internal_key) => tap_internal_key, None => bail!(foreign_count, "it doesn't have an tap_internal_key"), }; let (fingerprint, derivation_path) = match input.tap_key_origins.get(tap_internal_key) { Some(origin) => origin.1.clone(), None => bail!( foreign_count, "it doesn't provide a source for the tap_internal_key" ), }; if fingerprint != our_fingerprint { bail!( foreign_count, "it's key fingerprint doesn't match our root key" ); } let normal_derivation_path = derivation_path .into_iter() .map(|child_number| match child_number { bip32::ChildNumber::Normal { index } => Ok(*index), _ => Err(anyhow!("can't sign with hardened derivation")), }) .collect::<Result<Vec<_>>>()?; let bip32_path = match BitcoinBip32Path::from_u32_slice(&normal_derivation_path) { Some(bip32_path) => bip32_path, None => { bail!( foreign_count, format!( "it has an unusual derivation path {:?}", normal_derivation_path .into_iter() .map(|n| n.to_string()) .collect::<Vec<String>>() .join("/") ) ); } }; template.push_owned_input( input_push, frostsnap_core::bitcoin_transaction::LocalSpk { master_appkey, bip32_path, }, )?; owned_count += 1; } for (i, _) in psbt.outputs.iter().enumerate() { let txout = &rust_bitcoin_tx.output[i]; match self .tx_graph .index .index_of_spk(txout.script_pubkey.clone()) { Some(&((_, account_keychain), index)) => template.push_owned_output( txout.value, LocalSpk { master_appkey, bip32_path: BitcoinBip32Path { account_keychain, index, }, }, ), None => { template.push_foreign_output(txout.clone()); } } } // Validate that this PSBT is actually signable by this wallet if owned_count == 0 { return Err(PsbtValidationError::NothingToSign { total_inputs: psbt.inputs.len(), foreign_count, already_signed_count, }); } Ok(template) } } #[derive(Debug, Clone)] pub enum PsbtValidationError { NothingToSign { total_inputs: usize, foreign_count: usize, already_signed_count: usize, }, Other(String), } impl From<Box<bitcoin_transaction::SpkDoesntMatchPathError>> for PsbtValidationError { fn from(e: Box<bitcoin_transaction::SpkDoesntMatchPathError>) -> Self { PsbtValidationError::Other(e.to_string()) } } impl From<anyhow::Error> for PsbtValidationError { fn from(e: anyhow::Error) -> Self { PsbtValidationError::Other(e.to_string()) } } impl std::fmt::Display for PsbtValidationError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { PsbtValidationError::NothingToSign { total_inputs, foreign_count, already_signed_count, } => { let (input_word, pronoun) = if *total_inputs == 1 { ("input", "it") } else { ("inputs", "any of them") }; write!( f, "This PSBT has {total_inputs} {input_word} but this wallet can not sign {pronoun}" )?; let mut reasons = Vec::new(); if *foreign_count > 0 { reasons.push(format!("{foreign_count} not owned by this wallet")); } if *already_signed_count > 0 { reasons.push(format!("{already_signed_count} already signed")); } if !reasons.is_empty() { write!(f, " ({})", reasons.join(", "))?; } write!(f, ".") } PsbtValidationError::Other(msg) => write!(f, "{msg}"), } } } impl std::error::Error for PsbtValidationError {} #[derive(Clone, Debug)] pub struct AddressInfo { pub index: u32, pub address: bitcoin::Address, pub external: bool, pub used: bool, pub revealed: bool, pub derivation_path: Vec<u32>, } #[derive(Clone, Debug)] pub struct Transaction { pub inner: Arc<bitcoin::Transaction>, pub txid: Txid, pub confirmation_time: Option<ConfirmationTime>, pub last_seen: Option<u64>, pub prevouts: HashMap<OutPoint, TxOut>, pub is_mine: HashSet<ScriptBuf>, } #[derive(Clone, Debug)] pub struct ConfirmationTime { pub height: u32, pub time: u64, } #[cfg(test)] mod test { use super::*; use bitcoin::key::{Secp256k1, TweakedPublicKey}; use frostsnap_core::{schnorr_fun::fun::Point, tweak::AppTweak}; #[test] fn wallet_descriptors_match_our_tweaking() { let master_appkey = MasterAppkey::derive_from_rootkey(Point::random(&mut rand::thread_rng())); let descriptors = CoordSuperWallet::descriptors_for_key(master_appkey, bitcoin::NetworkKind::Main); let (account_keychain, external_descriptor) = &descriptors[0]; let xonly = AppTweak::Bitcoin(BitcoinBip32Path { account_keychain: *account_keychain, index: 42, }) .derive_xonly_key(&master_appkey.to_xpub()); let definite_descriptor = external_descriptor.at_derivation_index(42).unwrap(); definite_descriptor .derived_descriptor(&Secp256k1::default()) .unwrap() .to_string();
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/outgoing.rs
frostsnap_coordinator/src/bitcoin/outgoing.rs
use std::collections::VecDeque; use bdk_chain::bitcoin::Txid; /// Tracks outgoing transactions. #[derive(Clone, Default)] pub struct OutgoingTracker { /// Queue of the outgoing transactions. queue: VecDeque<Txid>, } pub enum Mutation { Push(Txid), Forget(Txid), } impl OutgoingTracker { pub fn queue(&self) -> &VecDeque<Txid> { &self.queue } pub fn forget(&mut self, txid: Txid) -> bool { let to_forget = self .queue .iter() .enumerate() .find(|(_, &i_txid)| i_txid == txid) .map(|(i, _)| i); if let Some(i) = to_forget { self.queue.remove(i); true } else { false } } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/connection.rs
frostsnap_coordinator/src/bitcoin/tofu/connection.rs
use anyhow::anyhow; use bdk_chain::bitcoin::BlockHash; use futures::{pin_mut, select, FutureExt, StreamExt}; use rustls::client::WebPkiServerVerifier; use rustls::pki_types::ServerName; use rustls::ClientConfig; use std::sync::Arc; use std::time::Duration; use tokio::net::TcpStream; use tokio_rustls::{client::TlsStream, TlsConnector}; use super::trusted_certs::TrustedCertificates; use super::verifier::{TofuCertVerifier, TofuError}; use crate::persist::Persisted; type SplitConn<T> = (tokio::io::ReadHalf<T>, tokio::io::WriteHalf<T>); pub enum Conn { Tcp(SplitConn<tokio::net::TcpStream>), Ssl(SplitConn<TlsStream<tokio::net::TcpStream>>), } impl Conn { pub async fn new( genesis_hash: BlockHash, url: &str, timeout: Duration, trusted_certificates: &mut Persisted<TrustedCertificates>, ) -> Result<Self, TofuError> { let connect_fut = async { let (is_ssl, socket_addr) = match url.split_once("://") { Some(("ssl", socket_addr)) => (true, socket_addr.to_owned()), Some(("tcp", socket_addr)) => (false, socket_addr.to_owned()), Some((unknown_scheme, _)) => { return Err(TofuError::Other(anyhow!( "unknown url scheme '{unknown_scheme}'" ))); } None => (false, url.to_owned()), }; tracing::info!(url, "Connecting"); if is_ssl { let host = socket_addr .clone() .split_once(":") .map(|(host, _)| host.to_string()) .unwrap_or(socket_addr.clone()); let stream = connect_with_tofu(&socket_addr, &host, trusted_certificates).await?; let (mut rh, mut wh) = tokio::io::split(stream); check_conn(&mut rh, &mut wh, genesis_hash) .await .map_err(TofuError::Other) .inspect_err(|e| tracing::error!("Network check failed: {:?}", e))?; Ok(Conn::Ssl((rh, wh))) } else { let sock = tokio::net::TcpStream::connect(&socket_addr) .await .map_err(|e| { tracing::error!("TCP connection failed to {}: {}", socket_addr, e); TofuError::Other(e.into()) })?; let (mut rh, mut wh) = tokio::io::split(sock); check_conn(&mut rh, &mut wh, genesis_hash) .await .map_err(TofuError::Other) .inspect_err(|e| tracing::error!("Network check failed: {:?}", e))?; Ok(Conn::Tcp((rh, wh))) } } .fuse(); pin_mut!(connect_fut); let timeout_fut = tokio::time::sleep(timeout).fuse(); pin_mut!(timeout_fut); select! { conn_res = connect_fut => conn_res, _ = timeout_fut => { tracing::error!("Connection to {} timed out after {:?}", url, timeout); Err(TofuError::Other(anyhow!("Timed out"))) }, } } } /// Attempt to connect with TOFU support async fn connect_with_tofu( socket_addr: &str, host: &str, trusted_certificates: &mut Persisted<TrustedCertificates>, ) -> Result<TlsStream<TcpStream>, TofuError> { // Create combined certificate store with PKI roots and TOFU certs let root_store = trusted_certificates.create_combined_cert_store(); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .map_err(|e| TofuError::Other(anyhow!("Failed to create verifier: {:?}", e)))?; let tofu_verifier = Arc::new(TofuCertVerifier::new( base_verifier, trusted_certificates.clone(), )); let config = ClientConfig::builder() .dangerous() .with_custom_certificate_verifier(tofu_verifier.clone()) .with_no_client_auth(); let dnsname = ServerName::try_from(host.to_owned()) .map_err(|e| TofuError::Other(anyhow!("Invalid DNS name: {}", e)))?; let sock = TcpStream::connect(socket_addr).await.map_err(|e| { tracing::error!("TCP connection failed to {}: {}", socket_addr, e); TofuError::Other(anyhow!("TCP connection failed: {}", e)) })?; let connector = TlsConnector::from(Arc::new(config)); match connector.connect(dnsname.clone(), sock).await { Ok(stream) => Ok(stream), Err(e) => { // Check if there's a TOFU error stored for this connection if let Some(tofu_error) = tofu_verifier.take_tofu_error(host) { tracing::info!( "TLS connection rejected due to TOFU verification: {:?}", tofu_error ); Err(tofu_error) } else { // No TOFU error stored, return the rustls error tracing::error!("TLS handshake failed for {}: {}", host, e); // The error from connector.connect() is std::io::Error // We need to check if it contains a rustls error let error_msg = if let Some(inner) = e.get_ref() { // Try to get more specific error information let inner_str = inner.to_string(); if inner_str.contains("UnsupportedCertVersion") { format!("{}'s X.509 certificate version is too old", host) } else if inner_str.contains("UnknownIssuer") { format!("{}'s certificate issuer unknown", host) } else if inner_str.contains("invalid peer certificate") { format!("{}'s certificate invalid: {}", host, inner_str) } else { format!("TLS handshake failed: {}", e) } } else { format!("TLS handshake failed: {}", e) }; Err(TofuError::Other(anyhow!(error_msg))) } } } } /// Check that the connection actually connects to an Electrum server and the server is on the right /// network. async fn check_conn<R, W>(rh: R, mut wh: W, genesis_hash: BlockHash) -> anyhow::Result<()> where R: tokio::io::AsyncRead + Unpin, W: tokio::io::AsyncWrite + Unpin, { use bdk_electrum_streaming::electrum_streaming_client as client; use client::request; use client::RawNotificationOrResponse; use client::Request; use futures::io::BufReader; use tokio_util::compat::TokioAsyncReadCompatExt; let req_id = rand::random::<u32>(); let req = client::RawRequest::from_request(req_id, request::Header { height: 0 }); client::io::tokio_write(&mut wh, req).await?; let mut read_stream = client::io::ReadStreamer::new(BufReader::new(rh.compat())); let raw_incoming = read_stream .next() .await .ok_or(anyhow!("failed to get response from server"))??; let raw_resp = match raw_incoming { RawNotificationOrResponse::Notification(_) => { return Err(anyhow!("Received unexpected notification from server")) } RawNotificationOrResponse::Response(raw_resp) => raw_resp, }; if raw_resp.id != req_id { return Err(anyhow!( "Response id {} does not match request id {}", raw_resp.id, req_id )); } let raw_val = raw_resp .result .map_err(|err| anyhow!("Server responded with error: {err}"))?; let resp: <request::Header as Request>::Response = client::serde_json::from_value(raw_val)?; if genesis_hash != resp.header.block_hash() { return Err(anyhow!("Electrum server is on a different network")); } Ok(()) } #[derive(Debug, Clone)] pub struct TargetServerReq { pub url: String, pub is_backup: bool, }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/mod.rs
frostsnap_coordinator/src/bitcoin/tofu/mod.rs
pub mod connection; pub mod trusted_certs; pub mod verifier;
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/verifier.rs
frostsnap_coordinator/src/bitcoin/tofu/verifier.rs
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}; use rustls::pki_types::{CertificateDer, ServerName, UnixTime}; use rustls::{DigitallySignedStruct, Error as RustlsError, SignatureScheme}; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use super::trusted_certs::TrustedCertificates; /// Extension trait for certificate fingerprinting pub trait CertificateExt { /// Get SHA256 fingerprint as hex string (no formatting) fn sha256_fingerprint(&self) -> String; } impl CertificateExt for CertificateDer<'_> { fn sha256_fingerprint(&self) -> String { use frostsnap_core::hex; use sha2::{Digest, Sha256}; hex::encode(&Sha256::digest(self.as_ref())) } } /// An untrusted certificate that needs user approval #[derive(Debug, Clone)] pub struct UntrustedCertificate { pub fingerprint: String, pub server_url: String, pub is_changed: bool, pub old_fingerprint: Option<String>, pub certificate_der: Vec<u8>, /// If the certificate was rejected due to name mismatch, this contains the names it's valid for pub valid_for_names: Option<Vec<String>>, } /// Custom error type that includes certificate data for TOFU prompts #[derive(Debug)] pub enum TofuError { /// Certificate not trusted - needs user approval NotTrusted(UntrustedCertificate), /// Other connection error Other(anyhow::Error), } impl std::fmt::Display for TofuError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { TofuError::NotTrusted(cert) => { if cert.is_changed { write!(f, "Certificate changed for {}", cert.server_url) } else { write!(f, "Untrusted certificate for {}", cert.server_url) } } TofuError::Other(ref e) => write!(f, "{}", e), } } } impl std::error::Error for TofuError {} impl From<anyhow::Error> for TofuError { fn from(err: anyhow::Error) -> Self { TofuError::Other(err) } } /// A certificate verifier that captures certificates when validation fails /// /// # TOFU Implementation Trade-offs /// /// This implementation uses a pragmatic approach to TOFU (Trust On First Use) that has /// some important security trade-offs: /// /// 1. **Certificate Validation Order**: We rely on rustls's base verifier to validate /// certificates. This means validation happens in a specific order (parsing, type /// checking, signature verification, trust chain validation). We only capture /// certificates that fail at the trust chain level (UnknownIssuer, etc.). /// /// 2. **Signature Verification Limitation**: We CANNOT guarantee that captured certificates /// have valid signatures. If a certificate fails for UnknownIssuer before signature /// verification happens, we'll still capture it. This means a tampered certificate /// could theoretically be presented for TOFU if it fails for other reasons first. /// /// 3. **Why We Accept This**: In practice, this is a reasonable trade-off because: /// - TOFU is already about accepting certificates outside the PKI trust model /// - The real security comes from detecting when certificates CHANGE after first trust /// - Implementing proper signature verification before capture would require /// reimplementing significant parts of X.509 validation /// - Most real-world attacks would produce certificates that fail validation entirely /// /// 4. **What We DO Guarantee**: /// - Certificates are properly scoped to specific servers (no certificate confusion) /// - Once trusted, we detect any changes to the certificate /// - We don't capture certificates with structural problems pub struct TofuCertVerifier { /// The base verifier that does actual validation base_verifier: Arc<dyn ServerCertVerifier>, /// Trusted certificates store trusted_certs: TrustedCertificates, /// Storage for TOFU errors indexed by server URL tofu_errors: Arc<Mutex<HashMap<String, TofuError>>>, } impl std::fmt::Debug for TofuCertVerifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("TofuCertVerifier").finish() } } impl TofuCertVerifier { pub fn new( base_verifier: Arc<dyn ServerCertVerifier>, trusted_certs: TrustedCertificates, ) -> Self { Self { base_verifier, trusted_certs, tofu_errors: Arc::new(Mutex::new(HashMap::new())), } } /// Extract the TOFU error for a specific server if any pub fn take_tofu_error(&self, server_url: &str) -> Option<TofuError> { self.tofu_errors.lock().unwrap().remove(server_url) } } impl ServerCertVerifier for TofuCertVerifier { fn verify_server_cert( &self, end_entity: &CertificateDer<'_>, intermediates: &[CertificateDer<'_>], server_name: &ServerName<'_>, ocsp_response: &[u8], now: UnixTime, ) -> Result<ServerCertVerified, RustlsError> { let server_str = server_name.to_str(); tracing::info!("TOFU verifier checking server: {}", server_str.as_ref()); // Check if we have a TOFU certificate for this server let previous_cert = self .trusted_certs .get_certificate_for_server(server_str.as_ref()); if let Some(trusted_cert) = &previous_cert { if trusted_cert == &end_entity { tracing::info!("Certificate matches TOFU trust store, accepting"); return Ok(ServerCertVerified::assertion()); } else { // Certificate changed - this requires user approval, not PKI fallback tracing::warn!( "Certificate for {} has changed - capturing for user approval", server_str.as_ref() ); let untrusted_cert = UntrustedCertificate { fingerprint: end_entity.sha256_fingerprint(), server_url: server_str.to_string(), is_changed: true, old_fingerprint: Some(trusted_cert.sha256_fingerprint()), certificate_der: end_entity.to_vec(), valid_for_names: None, }; let tofu_error = TofuError::NotTrusted(untrusted_cert); self.tofu_errors .lock() .unwrap() .insert(server_str.to_string(), tofu_error); return Err(RustlsError::General( "Certificate changed - requires user approval".to_string(), )); } } else { tracing::info!("No stored certificate found for {}", server_str.as_ref()); } match self.base_verifier.verify_server_cert( end_entity, intermediates, server_name, ocsp_response, now, ) { Ok(verified) => { tracing::debug!("Certificate validated via PKI for {}", server_str); Ok(verified) } Err(e) => { // Only capture certificates that fail due to trust issues, not structural issues // This is a best-effort filter - we try to capture certificates that are // structurally valid but not trusted by the PKI model. // // IMPORTANT: Due to validation order in rustls, we cannot guarantee that // certificates with invalid signatures won't be captured. If a certificate // fails for UnknownIssuer before signature verification, it will be captured. let should_capture = match &e { RustlsError::InvalidCertificate(cert_err) => match cert_err { rustls::CertificateError::UnknownIssuer | // Self-signed or unknown CA rustls::CertificateError::UnhandledCriticalExtension | // Unusual but valid cert rustls::CertificateError::NotValidForName | // Name mismatch (might be OK for TOFU) rustls::CertificateError::NotValidForNameContext { .. } | // Name mismatch with details rustls::CertificateError::InvalidPurpose => true, // Wrong key usage (might be OK for TOFU) rustls::CertificateError::Other(other_err) => { // Check if it's UnsupportedCertVersion - if so, don't capture because we'll never be able to set up the connection anyway. let err_str = format!("{:?}", other_err); !err_str.contains("UnsupportedCertVersion") } // We explicitly don't capture: // - BadSignature (definitely tampered) // - ApplicationVerificationFailure _ => false, }, _ => false, }; if should_capture { let valid_for_names = match &e { RustlsError::InvalidCertificate( rustls::CertificateError::NotValidForNameContext { expected: _, presented, }, ) => Some(presented.clone()), _ => None, }; let untrusted_cert = UntrustedCertificate { fingerprint: end_entity.sha256_fingerprint(), server_url: server_str.to_string(), is_changed: previous_cert.is_some(), old_fingerprint: previous_cert.map(|cert| cert.sha256_fingerprint()), certificate_der: end_entity.to_vec(), valid_for_names, }; let tofu_error = TofuError::NotTrusted(untrusted_cert); self.tofu_errors .lock() .unwrap() .insert(server_str.to_string(), tofu_error); } Err(e) } } } fn verify_tls12_signature( &self, message: &[u8], cert: &CertificateDer<'_>, dss: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, RustlsError> { self.base_verifier .verify_tls12_signature(message, cert, dss) } fn verify_tls13_signature( &self, message: &[u8], cert: &CertificateDer<'_>, dss: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, RustlsError> { self.base_verifier .verify_tls13_signature(message, cert, dss) } fn supported_verify_schemes(&self) -> Vec<SignatureScheme> { self.base_verifier.supported_verify_schemes() } } #[cfg(test)] mod tests { use super::*; use crate::bitcoin::tofu::trusted_certs::TrustedCertificates; use rustls::client::WebPkiServerVerifier; use rustls::pki_types::{ServerName, UnixTime}; const TEST_CERT1: &[u8] = include_bytes!("../../../tests/certs/test1.der"); const TEST_CERT2: &[u8] = include_bytes!("../../../tests/certs/test2.der"); #[test] fn test_certificate_fingerprint_format() { const ELECTRUM_CERT: &[u8] = include_bytes!("../tofu/certs/electrum.frostsn.app.der"); let cert = CertificateDer::from(ELECTRUM_CERT.to_vec()); // Expected fingerprint from: openssl x509 -in electrum.frostsn.app.der -inform DER -noout -fingerprint -sha256 const OPENSSL_FINGERPRINT: &str = "9F:32:AC:77:62:64:67:39:C2:FE:62:17:04:09:8F:DA:E4:94:49:BB:B1:E2:3A:FB:F8:ED:22:47:B6:F9:15:F9"; let expected = OPENSSL_FINGERPRINT.replace(':', "").to_lowercase(); assert_eq!( cert.sha256_fingerprint(), expected, "Fingerprint should be raw hex SHA256" ); } #[test] fn test_tofu_first_use_capture() { let trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let test_cert1 = CertificateDer::from(TEST_CERT1.to_vec()); let server_name = ServerName::try_from("test.example.com").unwrap(); let now = UnixTime::now(); let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .unwrap(); let tofu_verifier = TofuCertVerifier::new(base_verifier.clone(), trusted_certs.clone()); let result = tofu_verifier.verify_server_cert(&test_cert1, &[], &server_name, &[], now); assert!(result.is_err(), "First connection should fail"); let tofu_error = tofu_verifier.take_tofu_error("test.example.com"); assert!(tofu_error.is_some(), "Should have captured TOFU error"); match tofu_error.unwrap() { TofuError::NotTrusted(cert) => { assert!(!cert.is_changed); assert_eq!(cert.certificate_der, test_cert1.as_ref()); } _ => panic!("Expected NotTrusted error"), } } #[test] fn test_tofu_trusted_certificate_accepted() { let mut trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let mut mutations = Vec::new(); let test_cert1 = CertificateDer::from(TEST_CERT1.to_vec()); let server_name = ServerName::try_from("test.example.com").unwrap(); let now = UnixTime::now(); trusted_certs.add_certificate( test_cert1.clone(), "test.example.com".to_string(), &mut mutations, ); let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .unwrap(); let tofu_verifier = TofuCertVerifier::new(base_verifier, trusted_certs); let result = tofu_verifier.verify_server_cert(&test_cert1, &[], &server_name, &[], now); assert!(result.is_ok(), "Trusted certificate should be accepted"); } #[test] fn test_tofu_certificate_change_detection() { let mut trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let mut mutations = Vec::new(); let test_cert1 = CertificateDer::from(TEST_CERT1.to_vec()); let test_cert2 = CertificateDer::from(TEST_CERT2.to_vec()); let server_name = ServerName::try_from("test.example.com").unwrap(); let now = UnixTime::now(); trusted_certs.add_certificate( test_cert1.clone(), "test.example.com".to_string(), &mut mutations, ); let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .unwrap(); let tofu_verifier = TofuCertVerifier::new(base_verifier, trusted_certs); let result = tofu_verifier.verify_server_cert(&test_cert2, &[], &server_name, &[], now); assert!(result.is_err(), "Different certificate should fail"); let tofu_error = tofu_verifier.take_tofu_error("test.example.com"); assert!( tofu_error.is_some(), "Should have captured changed certificate" ); match tofu_error.unwrap() { TofuError::NotTrusted(cert) => { assert!(cert.is_changed, "Should be marked as changed"); assert_eq!(cert.certificate_der, test_cert2.as_ref()); assert_eq!(cert.old_fingerprint, Some(test_cert1.sha256_fingerprint())); } _ => panic!("Expected NotTrusted error"), } } #[test] fn test_certificate_confusion_attack_prevention() { // This test should FAIL if the vulnerability exists // A certificate accepted for one server should NOT be accepted for a different server let mut trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let mut mutations = Vec::new(); // Load our test certificates let cert = CertificateDer::from(TEST_CERT1.to_vec()); // Create base verifier let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .unwrap(); // Step 1: User accepts a certificate for attacker.com trusted_certs.add_certificate(cert.clone(), "attacker.com".to_string(), &mut mutations); let tofu_verifier = TofuCertVerifier::new(base_verifier.clone(), trusted_certs.clone()); // Step 2: Attacker tries to use the same certificate for bank.com let bank_server_name = ServerName::try_from("bank.com").unwrap(); let now = UnixTime::now(); let result = tofu_verifier.verify_server_cert(&cert, &[], &bank_server_name, &[], now); // This SHOULD fail - the certificate should NOT be accepted for bank.com assert!( result.is_err(), "Certificate should NOT be accepted for a different server!" ); // The certificate should be captured as unverified let tofu_error = tofu_verifier.take_tofu_error("bank.com"); assert!( tofu_error.is_some(), "Should have captured the certificate for TOFU prompt" ); match tofu_error.unwrap() { TofuError::NotTrusted(cert) => { assert!(!cert.is_changed); // First time seeing cert for bank.com assert_eq!(cert.server_url, "bank.com"); } _ => panic!("Expected NotTrusted error for bank.com"), } } #[test] fn test_certificate_change_detection() { let mut trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let mut mutations = Vec::new(); // Add a certificate for a server let cert1 = CertificateDer::from(TEST_CERT1.to_vec()); trusted_certs.add_certificate(cert1.clone(), "example.com:443".to_string(), &mut mutations); // Check if we can find it let certs = trusted_certs.get_all_certificates(); let found = certs.iter().find(|(url, _)| url == "example.com:443"); assert!(found.is_some(), "Should find the certificate"); assert_eq!(found.unwrap().1.certificate, cert1); // Verify we can get the certificate back assert_eq!( trusted_certs.get_certificate_for_server("example.com:443"), Some(&cert1) ); // Try to add a different certificate for the same server let cert2 = CertificateDer::from(TEST_CERT2.to_vec()); let old_fingerprint = cert1.sha256_fingerprint(); let new_fingerprint = cert2.sha256_fingerprint(); // Add second certificate (should replace the first one) trusted_certs.add_certificate(cert2.clone(), "example.com:443".to_string(), &mut mutations); // Only the second certificate should be stored for this server now assert_eq!( trusted_certs.get_certificate_for_server("example.com:443"), Some(&cert2), "Server should now have cert2" ); // Verify fingerprints are different assert_ne!(new_fingerprint, old_fingerprint); // We should still have only 1 certificate assert_eq!(trusted_certs.get_all_certificates().len(), 1); } #[test] fn test_unsupported_cert_version_not_captured() { // This test verifies that certificates with unsupported versions // (like X.509 v1) are not captured for TOFU and fail immediately // Load emzy's cert which has X.509 v1 const EMZY_CERT: &[u8] = include_bytes!("../../../tests/certs/emzy.der"); let emzy_cert = CertificateDer::from(EMZY_CERT.to_vec()); let server_name = ServerName::try_from("electrum.emzy.de").unwrap(); let now = UnixTime::now(); let trusted_certs = TrustedCertificates::new_for_test(bdk_chain::bitcoin::Network::Bitcoin); let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let base_verifier = WebPkiServerVerifier::builder(Arc::new(root_store)) .build() .unwrap(); let tofu_verifier = TofuCertVerifier::new(base_verifier.clone(), trusted_certs); // Try to verify the cert - should fail with UnsupportedCertVersion let result = tofu_verifier.verify_server_cert(&emzy_cert, &[], &server_name, &[], now); assert!(result.is_err()); let err = result.unwrap_err(); // Check that it's an UnsupportedCertVersion error assert!( format!("{:?}", err).contains("UnsupportedCertVersion"), "Expected UnsupportedCertVersion error, got: {:?}", err ); // Most importantly: verify NO TOFU error was captured let tofu_error = tofu_verifier.take_tofu_error("electrum.emzy.de"); assert!( tofu_error.is_none(), "Should NOT capture TOFU error for unsupported cert version" ); } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/trusted_certs.rs
frostsnap_coordinator/src/bitcoin/tofu/trusted_certs.rs
use anyhow::Result; use bdk_chain::{bitcoin, rusqlite_impl::migrate_schema}; use rusqlite::params; use rustls::RootCertStore; use rustls_pki_types::CertificateDer; use std::collections::HashMap; use std::time::{SystemTime, UNIX_EPOCH}; use super::verifier::CertificateExt; use crate::persist::Persist; #[derive(Clone, Debug)] pub struct TrustedCertificate { pub certificate: CertificateDer<'static>, pub added_at: i64, // Unix timestamp } #[derive(Debug, Clone)] pub struct TrustedCertificates { /// The network this certificate store is for network: bitcoin::Network, /// Maps server_url -> trusted certificate certificates: HashMap<String, TrustedCertificate>, } #[derive(Debug, Clone)] pub enum CertificateMutation { Add { network: bitcoin::Network, certificate: CertificateDer<'static>, server_url: String, }, Remove { network: bitcoin::Network, server_url: String, }, } impl TrustedCertificates { pub fn apply_mutation(&mut self, mutation: &CertificateMutation) -> bool { match mutation { CertificateMutation::Add { network: _, // Already filtered by network during load certificate, server_url, } => { let added_at = SystemTime::now() .duration_since(UNIX_EPOCH) .map(|d| d.as_secs() as i64) .unwrap_or(0); self.certificates.insert( server_url.clone(), TrustedCertificate { certificate: certificate.clone(), added_at, }, ); true } CertificateMutation::Remove { network: _, server_url, } => self.certificates.remove(server_url).is_some(), } } fn mutate(&mut self, mutation: CertificateMutation, mutations: &mut Vec<CertificateMutation>) { if self.apply_mutation(&mutation) { tracing::debug!("Certificate store mutation: {:?}", mutation); mutations.push(mutation); } } pub fn add_certificate( &mut self, cert: CertificateDer<'static>, server_url: String, mutations: &mut Vec<CertificateMutation>, ) { // HashMap will automatically replace any existing entry self.mutate( CertificateMutation::Add { network: self.network, certificate: cert, server_url, }, mutations, ); } pub fn remove_certificate( &mut self, server_url: String, mutations: &mut Vec<CertificateMutation>, ) { self.mutate( CertificateMutation::Remove { network: self.network, server_url, }, mutations, ); } pub fn create_combined_cert_store(&self) -> RootCertStore { // Start with standard PKI certificates from webpki-roots let mut store = RootCertStore::empty(); store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); // Add user-trusted certificates for (server_url, trusted_cert) in &self.certificates { if let Err(e) = store.add(trusted_cert.certificate.clone()) { tracing::warn!( "Failed to add trusted certificate for {}: {:?}", server_url, e ); } } store } /// Find a certificate by its SHA256 fingerprint (raw hex, no colons) pub fn find_certificate_by_fingerprint( &self, fingerprint: &str, ) -> Option<(&str, &TrustedCertificate)> { self.certificates .iter() .find(|(_, cert)| cert.certificate.sha256_fingerprint() == fingerprint) .map(|(url, cert)| (url.as_str(), cert)) } pub fn get_all_certificates(&self) -> Vec<(String, TrustedCertificate)> { self.certificates .iter() .map(|(url, cert)| (url.clone(), cert.clone())) .collect() } pub fn get_certificate_for_server(&self, server_url: &str) -> Option<&CertificateDer<'_>> { self.certificates.get(server_url).map(|tc| &tc.certificate) } #[cfg(test)] pub fn new_for_test(network: bitcoin::Network) -> Self { Self { network, certificates: HashMap::new(), } } } // Pre-trusted certificate for electrum.frostsn.app const ELECTRUM_FROSTSN_APP_CERT: &[u8] = include_bytes!("certs/electrum.frostsn.app.der"); const ELECTRUM_FROSTSN_APP_URL: &str = "electrum.frostsn.app"; const SCHEMA_NAME: &str = "frostsnap_electrum_tofu"; const MIGRATIONS: &[&str] = &[ // Version 0 - initial schema "CREATE TABLE IF NOT EXISTS fs_trusted_certificates ( network TEXT NOT NULL, server_url TEXT NOT NULL, certificate BLOB NOT NULL, added_at INTEGER NOT NULL, PRIMARY KEY (network, server_url) )", ]; impl Persist<rusqlite::Connection> for TrustedCertificates { type Update = Vec<CertificateMutation>; type LoadParams = bitcoin::Network; fn migrate(conn: &mut rusqlite::Connection) -> Result<()> { let db_tx = conn.transaction()?; migrate_schema(&db_tx, SCHEMA_NAME, MIGRATIONS)?; // Check if we need to add pre-trusted certificate (only on first run) let needs_init: i64 = db_tx.query_row( "SELECT COUNT(*) FROM fs_trusted_certificates WHERE network = 'bitcoin' AND server_url = ?1", params![ELECTRUM_FROSTSN_APP_URL], |row| row.get(0), ).unwrap_or(0); if needs_init == 0 { tracing::info!("First time initialization - adding pre-trusted certificate for electrum.frostsn.app"); let electrum_cert = CertificateDer::from(ELECTRUM_FROSTSN_APP_CERT.to_vec()); let added_at = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() as i64; // Add the certificate for bitcoin mainnet since electrum.frostsn.app:50002 is used for mainnet db_tx.execute( "INSERT INTO fs_trusted_certificates (network, server_url, certificate, added_at) VALUES (?1, ?2, ?3, ?4)", params!["bitcoin", ELECTRUM_FROSTSN_APP_URL, electrum_cert.as_ref(), added_at], )?; } db_tx.commit()?; Ok(()) } fn load(conn: &mut rusqlite::Connection, network: Self::LoadParams) -> Result<Self> where Self: Sized, { let mut stmt = conn.prepare( "SELECT server_url, certificate, added_at FROM fs_trusted_certificates WHERE network = ?1", )?; let cert_iter = stmt.query_map([network.to_string()], |row| { let server_url: String = row.get(0)?; let cert_blob: Vec<u8> = row.get(1)?; let added_at: i64 = row.get(2)?; Ok(( server_url, TrustedCertificate { certificate: CertificateDer::from(cert_blob), added_at, }, )) })?; let mut trusted_certs = TrustedCertificates { network, certificates: HashMap::new(), }; for cert_result in cert_iter { match cert_result { Ok((server_url, cert)) => { tracing::debug!( "Loaded trusted certificate for {} on network {} added at {}", server_url, network, cert.added_at ); // Directly insert to preserve the original added_at timestamp trusted_certs.certificates.insert(server_url, cert); } Err(e) => { tracing::warn!("Failed to load trusted certificate: {:?}", e); } } } tracing::info!( "Loaded {} trusted certificates for {} network", trusted_certs.certificates.len(), network ); Ok(trusted_certs) } fn persist_update(&self, conn: &mut rusqlite::Connection, update: Self::Update) -> Result<()> { for mutation in update { match mutation { CertificateMutation::Add { network, certificate, server_url, } => { let added_at = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() as i64; tracing::info!( "Adding trusted certificate for {} on {} network", server_url, network ); conn.execute( "INSERT OR REPLACE INTO fs_trusted_certificates (network, server_url, certificate, added_at) VALUES (?1, ?2, ?3, ?4)", params![ network.to_string(), server_url, certificate.as_ref(), added_at ], )?; } CertificateMutation::Remove { network, server_url, } => { tracing::info!( "Removing trusted certificate for {} on {} network", server_url, network ); let rows_affected = conn.execute( "DELETE FROM fs_trusted_certificates WHERE network = ?1 AND server_url = ?2", params![network.to_string(), server_url], )?; if rows_affected == 0 { tracing::warn!( "Attempted to remove certificate for {} but it was not found", server_url ); } } } } Ok(()) } } #[cfg(test)] mod tests { use super::*; use tempfile::NamedTempFile; fn create_test_cert() -> CertificateDer<'static> { // This is a dummy certificate for testing CertificateDer::from(vec![0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01]) } #[test] fn test_persist_and_load() -> Result<()> { let temp_file = NamedTempFile::new()?; let mut conn = rusqlite::Connection::open(temp_file.path())?; // Migrate and load store - it will have pre-trusted certificates TrustedCertificates::migrate(&mut conn)?; let mut store = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; let initial_count = store.certificates.len(); // Add a certificate let cert = create_test_cert(); let mut mutations = Vec::new(); store.add_certificate( cert.clone(), "test.example.com:443".to_string(), &mut mutations, ); // Persist the mutation store.persist_update(&mut conn, mutations)?; // Load again and verify let loaded_store = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; assert_eq!(loaded_store.certificates.len(), initial_count + 1); assert!(loaded_store .certificates .contains_key("test.example.com:443")); Ok(()) } #[test] fn test_remove_certificate() -> Result<()> { let temp_file = NamedTempFile::new()?; let mut conn = rusqlite::Connection::open(temp_file.path())?; // Migrate and load, then add a certificate TrustedCertificates::migrate(&mut conn)?; let mut store = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; let initial_count = store.certificates.len(); let cert = create_test_cert(); let mut mutations = Vec::new(); store.add_certificate( cert.clone(), "test.example.com:443".to_string(), &mut mutations, ); store.persist_update(&mut conn, mutations)?; // Remove by server URL let mut mutations = Vec::new(); store.remove_certificate("test.example.com:443".to_string(), &mut mutations); store.persist_update(&mut conn, mutations)?; // Verify it's removed let loaded_store = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; assert_eq!(loaded_store.certificates.len(), initial_count); Ok(()) } #[test] fn test_pre_trusted_cert_only_inserted_once() -> Result<()> { let temp_file = NamedTempFile::new()?; // First initialization - should insert pre-trusted cert { let mut conn = rusqlite::Connection::open(temp_file.path())?; TrustedCertificates::migrate(&mut conn)?; let store1 = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; assert_eq!(store1.certificates.len(), 1); assert!(store1.certificates.contains_key(ELECTRUM_FROSTSN_APP_URL)); } // Second initialization - should NOT insert again { let mut conn = rusqlite::Connection::open(temp_file.path())?; TrustedCertificates::migrate(&mut conn)?; let store2 = TrustedCertificates::load(&mut conn, bitcoin::Network::Bitcoin)?; assert_eq!(store2.certificates.len(), 1); assert!(store2.certificates.contains_key(ELECTRUM_FROSTSN_APP_URL)); // Verify there's still only one row in the database let count: i64 = conn.query_row("SELECT COUNT(*) FROM fs_trusted_certificates", [], |row| { row.get(0) })?; assert_eq!(count, 1); } Ok(()) } #[test] fn test_apply_mutation() { let mut store = TrustedCertificates::new_for_test(bitcoin::Network::Bitcoin); let initial_count = store.certificates.len(); let cert = create_test_cert(); // Test add mutation let add_mutation = CertificateMutation::Add { network: bitcoin::Network::Bitcoin, certificate: cert.clone(), server_url: "test.example.com:443".to_string(), }; assert!(store.apply_mutation(&add_mutation)); assert_eq!(store.certificates.len(), initial_count + 1); assert!(store.certificates.contains_key("test.example.com:443")); // Test remove mutation let remove_mutation = CertificateMutation::Remove { network: bitcoin::Network::Bitcoin, server_url: "test.example.com:443".to_string(), }; assert!(store.apply_mutation(&remove_mutation)); assert_eq!(store.certificates.len(), initial_count); // Test removing non-existent certificate assert!(!store.apply_mutation(&remove_mutation)); } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/tests/firmware_digest_test.rs
frostsnap_coordinator/tests/firmware_digest_test.rs
use frostsnap_coordinator::{firmware::VersionNumber, FirmwareBin}; use frostsnap_core::hex; #[test] fn test_v0_0_1_firmware_digests() { let firmware_signed_bytes = include_bytes!("v0.0.1-firmware-signed.bin"); let firmware_unsigned_bytes = include_bytes!("v0.0.1-firmware-unsigned.bin"); let firmware_signed = FirmwareBin::new(firmware_signed_bytes) .validate() .expect("Failed to validate signed firmware"); let firmware_unsigned = FirmwareBin::new(firmware_unsigned_bytes) .validate() .expect("Failed to validate unsigned firmware"); // Expected digests from the release const EXPECTED_SIGNED_DIGEST: &str = "57161f80b41413b1053e272f9c3da8d16ecfce44793345be69f7fe03d93f4eb0"; const EXPECTED_UNSIGNED_DIGEST: &str = "8f45ae6b72c241a20798acbd3c6d3e54071cae73e335df1785f2d485a915da4c"; // Test 1: Hash of entire signed firmware (with signature block) let signed_hex = hex::encode(&firmware_signed.digest_with_signature().0); assert_eq!( signed_hex, EXPECTED_SIGNED_DIGEST, "Signed firmware digest doesn't match" ); // Test 2: Hash of unsigned firmware (deterministic build, firmware-only) let unsigned_hex = hex::encode(&firmware_unsigned.digest().0); assert_eq!( unsigned_hex, EXPECTED_UNSIGNED_DIGEST, "Unsigned firmware digest doesn't match" ); // Test 3: Signed firmware should have total_size > firmware_size assert_eq!( firmware_signed.total_size(), firmware_signed_bytes.len() as u32, "Signed firmware total_size should match actual bytes" ); assert!( firmware_signed.firmware_size() < firmware_signed.total_size(), "Signed firmware should have signature block (firmware_size < total_size)" ); // Test 4: Unsigned firmware should have firmware_size == total_size assert_eq!( firmware_unsigned.firmware_size(), firmware_unsigned.total_size(), "Unsigned firmware should have firmware_size == total_size" ); assert_eq!( firmware_unsigned.total_size(), firmware_unsigned_bytes.len() as u32, "Unsigned firmware total_size should match actual bytes" ); // Test 5: For unsigned firmware, digest() should equal the deterministic build digest let unsigned_firmware_only_hex = hex::encode(&firmware_unsigned.digest().0); assert_eq!( unsigned_firmware_only_hex, EXPECTED_UNSIGNED_DIGEST, "digest() should return firmware-only digest for unsigned firmware" ); // Test 6: For signed firmware, digest() should return firmware-only (deterministic) digest let firmware_only_hex = hex::encode(&firmware_signed.digest().0); assert_eq!( firmware_only_hex, EXPECTED_UNSIGNED_DIGEST, "digest() should return firmware-only digest (excluding signature) for signed firmware" ); // Test 7: Old firmware (v0.0.1) should report upgrade_digest_no_sig feature as false let signed_version = VersionNumber::from_digest(&firmware_signed.digest_with_signature()) .expect("Should find v0.0.1 signed firmware"); let unsigned_version = VersionNumber::from_digest(&firmware_unsigned.digest()) .expect("Should find v0.0.1 unsigned firmware"); assert!( !signed_version.features().upgrade_digest_no_sig, "v0.0.1 signed firmware should not support upgrade_digest_no_sig" ); assert!( !unsigned_version.features().upgrade_digest_no_sig, "v0.0.1 unsigned firmware should not support upgrade_digest_no_sig" ); // Test 8: Signed firmware should have is_signed() == true assert!( firmware_signed.is_signed(), "Signed firmware should have is_signed() == true" ); // Test 9: Unsigned firmware should have is_signed() == false assert!( !firmware_unsigned.is_signed(), "Unsigned firmware should have is_signed() == false" ); // Test 10: Both firmwares should have version information assert!( firmware_signed.version().is_some(), "Signed firmware should have version information" ); assert!( firmware_unsigned.version().is_some(), "Unsigned firmware should have version information" ); // Test 11: Version information should be v0.0.1 assert_eq!(firmware_signed.version().unwrap().to_string(), "0.0.1"); assert_eq!(firmware_unsigned.version().unwrap().to_string(), "0.0.1"); println!("✓ All firmware digest tests passed!"); println!( " - Signed firmware digest (with sig): {}", EXPECTED_SIGNED_DIGEST ); println!( " - Firmware-only digest (deterministic): {}", EXPECTED_UNSIGNED_DIGEST ); println!(" - digest() now returns firmware-only digest by default"); println!(" - v0.0.1 firmware correctly reports upgrade_digest_no_sig feature as false"); println!(" - is_signed() correctly identifies signed vs unsigned firmware"); println!(" - version() correctly returns v0.0.1 for both signed and unsigned"); }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/tests/tofu_tests.rs
frostsnap_coordinator/tests/tofu_tests.rs
use frostsnap_coordinator::bitcoin::tofu::trusted_certs::TrustedCertificates; use frostsnap_coordinator::persist::Persist; use rusqlite::Connection; use rustls_pki_types::ServerName; use std::sync::Arc; use tempfile::NamedTempFile; use tokio::net::TcpStream; use tokio_rustls::TlsConnector; #[tokio::test] async fn test_electrum_frostsn_app_ssl_connection() { // electrum.frostsn.app uses a self-signed certificate, so it requires TOFU // This test verifies that the pre-trusted certificate is properly loaded // Create a temporary database let temp_file = NamedTempFile::new().unwrap(); let mut conn = Connection::open(temp_file.path()).unwrap(); // Migrate and load TrustedCertificates - this should add the pre-trusted cert TrustedCertificates::migrate(&mut conn).unwrap(); let trusted_certs = TrustedCertificates::load(&mut conn, bdk_chain::bitcoin::Network::Bitcoin).unwrap(); // Verify that electrum.frostsn.app is pre-trusted assert!( trusted_certs .get_certificate_for_server("electrum.frostsn.app") .is_some(), "electrum.frostsn.app should be pre-trusted" ); } #[tokio::test] async fn test_ssl_connection_with_letsencrypt_ca() { let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let config = rustls::ClientConfig::builder() .with_root_certificates(root_store) .with_no_client_auth(); let addr = "blockstream.info:700"; let stream = match TcpStream::connect(addr).await { Ok(s) => s, Err(e) => { eprintln!("Skipping test - could not connect to {}: {:?}", addr, e); return; } }; let connector = TlsConnector::from(Arc::new(config)); let dnsname = ServerName::try_from("blockstream.info").unwrap(); let _tls_stream = connector .connect(dnsname, stream) .await .unwrap_or_else(|e| { panic!("TLS handshake failed for blockstream.info: {:?}", e); }); } #[tokio::test] async fn test_emzy_electrum_server() { let mut root_store = rustls::RootCertStore::empty(); root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let config = rustls::ClientConfig::builder() .with_root_certificates(root_store) .with_no_client_auth(); let addr = "electrum.emzy.de:50002"; let stream = match TcpStream::connect(addr).await { Ok(s) => s, Err(e) => { eprintln!("Skipping test - could not connect to {}: {:?}", addr, e); return; } }; let connector = TlsConnector::from(Arc::new(config)); let dnsname = ServerName::try_from("electrum.emzy.de").unwrap(); match connector.connect(dnsname, stream).await { Ok(_) => { println!( "Successfully connected to {} (note: would need certificate in store)", addr ); } Err(e) => { println!( "Expected failure - Emzy's self-signed cert not in our store: {:?}", e ); } } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/genuine_certificate.rs
frostsnap_comms/src/genuine_certificate.rs
use alloc::{string::String, vec::Vec}; use frostsnap_core::{ schnorr_fun::{ fun::{marker::EvenY, KeyPair, Point}, nonce::NonceGen, Message, Schnorr, Signature, }, sha2::Sha256, Versioned, }; pub const CERTIFICATE_BINCODE_CONFIG: bincode::config::Configuration< bincode::config::LittleEndian, bincode::config::Fixint, bincode::config::NoLimit, > = bincode::config::standard().with_fixed_int_encoding(); #[derive(bincode::Encode, bincode::Decode, Debug, Clone, PartialEq)] pub enum CertificateBody { Frontier { ds_public_key: Vec<u8>, case_color: CaseColor, revision: String, serial: String, timestamp: u64, }, } impl CertificateBody { pub fn serial_number(&self) -> String { match &self { // TODO maybe put revision number CertificateBody::Frontier { serial, .. } => format!("FS-F-{}", serial), } } pub fn raw_serial(&self) -> String { match &self { CertificateBody::Frontier { serial, .. } => serial.clone(), } } pub fn ds_public_key(&self) -> &Vec<u8> { match &self { CertificateBody::Frontier { ds_public_key, .. } => ds_public_key, } } } #[derive(bincode::Encode, bincode::Decode, Debug, Clone, PartialEq)] pub struct FrostsnapFactorySignature { pub factory_key: Point<EvenY>, // NOT for verification, just to know which factory pub signature: Signature, } #[derive(bincode::Encode, bincode::Decode, Debug, Clone, PartialEq)] pub struct Certificate { body: CertificateBody, factory_signature: Versioned<FrostsnapFactorySignature>, } impl Certificate { /// Should not be trusted, but useful in logging factory failures pub fn unverified_raw_serial(&self) -> String { self.body.raw_serial() } } #[derive(bincode::Encode, bincode::Decode, Debug, Copy, Clone, PartialEq)] pub enum CaseColor { Black, Orange, Silver, Blue, Red, Unused0, Unused1, Unused2, Unused3, Unused4, Unused5, Unused6, Unused8, Unused9, } impl core::fmt::Display for CaseColor { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let s = match self { CaseColor::Black => "Black", CaseColor::Orange => "Orange", CaseColor::Silver => "Silver", CaseColor::Blue => "Blue", CaseColor::Red => "Red", _ => "Black", }; write!(f, "{}", s) } } impl core::str::FromStr for CaseColor { type Err = String; fn from_str(s: &str) -> Result<Self, Self::Err> { match s.to_lowercase().as_str() { "black" => Ok(CaseColor::Black), "orange" => Ok(CaseColor::Orange), "silver" => Ok(CaseColor::Silver), "blue" => Ok(CaseColor::Blue), "red" => Ok(CaseColor::Red), _ => Err(format!("Invalid color: {}", s)), } } } pub struct CertificateVerifier; impl CertificateVerifier { /// Sign a new genuine certificate using the factory keypair pub fn sign<NG: NonceGen>( schnorr: Schnorr<Sha256, NG>, // RSA der bytes ds_public_key: Vec<u8>, case_color: CaseColor, revision: String, serial: String, timestamp: u64, factory_keypair: KeyPair<EvenY>, ) -> Certificate { let certificate_body = CertificateBody::Frontier { ds_public_key, case_color, timestamp, revision, serial, }; let certificate_bytes = bincode::encode_to_vec(&certificate_body, CERTIFICATE_BINCODE_CONFIG).unwrap(); let message = Message::new("frostsnap-genuine-key", &certificate_bytes); let factory_signature = FrostsnapFactorySignature { factory_key: factory_keypair.public_key(), signature: schnorr.sign(&factory_keypair, message), }; Certificate { body: certificate_body, factory_signature: Versioned::V0(factory_signature), } } /// Verify a genuine certificate before accessing the contents pub fn verify(certificate: &Certificate, factory_key: Point<EvenY>) -> Option<CertificateBody> { match &certificate.factory_signature { frostsnap_core::Versioned::V0(factory_signature) => { if factory_key != factory_signature.factory_key { // TODO: return error of UnknownFactoryKey return None; } let certificate_bytes = bincode::encode_to_vec(&certificate.body, CERTIFICATE_BINCODE_CONFIG).unwrap(); let message = Message::new("frostsnap-genuine-key", &certificate_bytes); let schnorr = Schnorr::<Sha256>::verify_only(); schnorr .verify(&factory_key, message, &factory_signature.signature) .then_some(certificate.body.clone()) } } } } #[cfg(test)] mod test { use std::string::ToString; use super::*; use frostsnap_core::schnorr_fun::fun::{KeyPair, Scalar}; use frostsnap_core::{schnorr_fun, sha2}; use rand_chacha::rand_core::SeedableRng; use rand_chacha::ChaCha20Rng; use rsa::pkcs1::EncodeRsaPublicKey; use rsa::RsaPrivateKey; #[test] pub fn certificate_sign_then_verify() { let mut test_rng = ChaCha20Rng::from_seed([42u8; 32]); let factory_secret = Scalar::random(&mut test_rng); let factory_keypair = KeyPair::new_xonly(factory_secret); let ds_public_key = RsaPrivateKey::new(&mut test_rng, crate::factory::DS_KEY_SIZE_BITS) .unwrap() .to_public_key(); let schnorr = schnorr_fun::new_with_deterministic_nonces::<sha2::Sha256>(); let certificate = CertificateVerifier::sign( schnorr, ds_public_key.to_pkcs1_der().unwrap().to_vec(), CaseColor::Orange, "2.7-1625".to_string(), // BOARD_REVISION "220825002".to_string(), 1971, factory_keypair, ); let verified_cert = CertificateVerifier::verify(&certificate, factory_keypair.public_key()).unwrap(); std::dbg!(verified_cert.serial_number()); } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/lib.rs
frostsnap_comms/src/lib.rs
#![no_std] #[cfg(feature = "std")] extern crate std; #[macro_use] extern crate alloc; pub mod factory; pub mod firmware_reader; pub mod fixed_string; pub mod genuine_certificate; use alloc::boxed::Box; use alloc::string::ToString; use alloc::vec::Vec; use alloc::{collections::BTreeSet, string::String}; use bincode::{de::read::Reader, enc::write::Writer, Decode, Encode}; use core::marker::PhantomData; use frostsnap_core::{DeviceId, Gist}; pub use fixed_string::{ DeviceName, FixedString, StringTooLong, DEVICE_NAME_MAX_LENGTH, KEY_NAME_MAX_LENGTH, }; use genuine_certificate::Certificate; pub const FACTORY_PUBLIC_KEY: [u8; 32] = [ 0xf3, 0xdb, 0x4b, 0x52, 0x53, 0xe7, 0xc5, 0x66, 0x9a, 0x7a, 0xe9, 0x52, 0x8a, 0x58, 0x51, 0x12, 0x7c, 0x4f, 0x70, 0x0c, 0x38, 0xfa, 0xe4, 0xeb, 0xac, 0x03, 0x40, 0x9d, 0x7d, 0x46, 0xea, 0x0b, ]; /// We choose this baudrate because esp32c3 freezes interrupts during flash /// erase cycles somtimes ~30ms. This is slow enough that the 128 byte uart /// FIFOs don't overlfow in that time. pub const BAUDRATE: u32 = 19_200; /// Magic bytes are 7 bytes in length so when the bincode prefixes it with `00` it is 8 bytes long. /// A nice round number here is desirable (but not strictly necessary) because TX and TX buffers /// will be some multiple of 8 and so it should overflow the ring buffers neatly. /// /// The last byte of magic bytes is used to signal features (by incrementing for new features). pub const MAGIC_BYTES_LEN: usize = 7; const MAGICBYTES_RECV_DOWNSTREAM: [u8; MAGIC_BYTES_LEN] = [0xff, 0xe4, 0x31, 0xb8, 0x02, 0x8b, 0x06]; const MAGICBYTES_RECV_UPSTREAM: [u8; MAGIC_BYTES_LEN] = [0xff, 0x5d, 0xa3, 0x85, 0xd4, 0xee, 0x5a]; /// Write magic bytes once every 100ms pub const MAGIC_BYTES_PERIOD: u64 = 100; pub const FIRMWARE_UPGRADE_CHUNK_LEN: u32 = 4096; // Secure Boot v2 signature block constants pub const SIGNATURE_BLOCK_SIZE: usize = firmware_reader::SECTOR_SIZE; pub const SIGNATURE_BLOCK_MAGIC: [u8; 4] = [0xE7, 0x02, 0x00, 0x00]; pub const FIRMWARE_NEXT_CHUNK_READY_SIGNAL: u8 = 0x11; /// Max memory we should use when deocding a message const MAX_MESSAGE_ALLOC_SIZE: usize = 1 << 15; pub const BINCODE_CONFIG: bincode::config::Configuration< bincode::config::LittleEndian, bincode::config::Varint, bincode::config::Limit<MAX_MESSAGE_ALLOC_SIZE>, > = bincode::config::standard().with_limit::<MAX_MESSAGE_ALLOC_SIZE>(); #[derive(Encode, Decode, Debug, Clone)] #[bincode( encode_bounds = "D: Direction", decode_bounds = "D: Direction, <D as Direction>::RecvType: bincode::Decode<__Context>", borrow_decode_bounds = "D: Direction, <D as Direction>::RecvType: bincode::BorrowDecode<'__de, __Context>" )] pub enum ReceiveSerial<D: Direction> { MagicBytes(MagicBytes<D>), Message(D::RecvType), /// You can only send messages if you have the conch. Also devices should only do work if no one /// downstream of them has the conch. Conch, Reset, // to allow devices to ignore messages they don't understand Unused8, Unused7, Unused6, Unused5, Unused4, Unused3, Unused2, Unused1, Unused0, } impl<D: Direction> Gist for ReceiveSerial<D> { fn gist(&self) -> String { match self { ReceiveSerial::MagicBytes(_) => "MagicBytes".into(), ReceiveSerial::Message(msg) => msg.gist(), ReceiveSerial::Conch => "Conch".into(), ReceiveSerial::Reset => "Reset".into(), _ => "Unused".into(), } } } /// A message sent from a coordinator #[derive(Encode, Decode, Debug, Clone)] pub struct CoordinatorSendMessage<B = CoordinatorSendBody> { pub target_destinations: Destination, pub message_body: B, } impl CoordinatorSendMessage { pub fn to(device_id: DeviceId, body: CoordinatorSendBody) -> Self { Self { target_destinations: Destination::Particular([device_id].into()), message_body: body, } } } #[cfg(feature = "coordinator")] impl TryFrom<frostsnap_core::coordinator::CoordinatorSend> for CoordinatorSendMessage<CoordinatorSendBody> { type Error = &'static str; fn try_from(value: frostsnap_core::coordinator::CoordinatorSend) -> Result<Self, Self::Error> { match value { frostsnap_core::coordinator::CoordinatorSend::ToDevice { message, destinations, } => Ok(CoordinatorSendMessage { target_destinations: Destination::from(destinations), message_body: CoordinatorSendBody::Core(message), }), _ => Err("was not a ToDevice message"), } } } #[derive(Encode, Decode, Debug, Clone)] pub enum Destination { /// Send to all devices -- this reduces message size for this common task All, Particular(BTreeSet<DeviceId>), } impl Destination { pub fn should_forward(&self) -> bool { match self { Self::All => true, Self::Particular(devices) => !devices.is_empty(), } } /// Returns whether the arugment `device_id` was a destination pub fn remove_from_recipients(&mut self, device_id: DeviceId) -> bool { match self { Destination::All => true, Destination::Particular(devices) => devices.remove(&device_id), } } pub fn is_destined_to(&mut self, device_id: DeviceId) -> bool { match self { Destination::All => true, Destination::Particular(devices) => devices.contains(&device_id), } } } impl Gist for Destination { fn gist(&self) -> String { match self { Destination::All => "ALL".into(), Destination::Particular(device_ids) => device_ids .iter() .map(ToString::to_string) .collect::<Vec<_>>() .join(","), } } } impl<I: IntoIterator<Item = DeviceId>> From<I> for Destination { fn from(iter: I) -> Self { Destination::Particular(BTreeSet::from_iter(iter)) } } impl<B: Gist> Gist for CoordinatorSendMessage<B> { fn gist(&self) -> String { self.message_body.gist() } } #[derive(Encode, Decode, Debug, Clone)] pub enum WireCoordinatorSendBody { _Core, _Naming, // ↑ Coord will never send these to old devices -- it will force firmware upgrade AnnounceAck, Cancel, Upgrade(CoordinatorUpgradeMessage), /// Everything should be encapsulated on the wire. The above is for backwards compat. EncapsV0(EncapsBody), } impl WireCoordinatorSendBody { pub fn decode(self) -> Option<CoordinatorSendBody> { use WireCoordinatorSendBody::*; match self { _Core | _Naming => None, AnnounceAck => Some(CoordinatorSendBody::AnnounceAck), Cancel => Some(CoordinatorSendBody::Cancel), Upgrade(upgrade) => Some(CoordinatorSendBody::Upgrade(upgrade)), EncapsV0(encaps) => bincode::decode_from_slice(encaps.0.as_ref(), BINCODE_CONFIG) .ok() .map(|(body, _)| body), } } } #[derive(Encode, Decode, Debug, Clone, PartialEq)] pub struct EncapsBody(Vec<u8>); #[derive(Encode, Decode, Debug, Clone)] pub enum CoordinatorSendBody { Core(frostsnap_core::message::CoordinatorToDeviceMessage), Naming(NameCommand), AnnounceAck, Cancel, Upgrade(CoordinatorUpgradeMessage), DataWipe, Challenge(Box<[u8; 32]>), } impl From<CoordinatorSendBody> for WireCoordinatorSendBody { fn from(value: CoordinatorSendBody) -> Self { use CoordinatorSendBody::*; match value { AnnounceAck => WireCoordinatorSendBody::AnnounceAck, Cancel => WireCoordinatorSendBody::Cancel, Upgrade(upgrade) => WireCoordinatorSendBody::Upgrade(upgrade), _ => WireCoordinatorSendBody::EncapsV0(EncapsBody( bincode::encode_to_vec(value, BINCODE_CONFIG).expect("encoding is infallible"), )), } } } impl From<CoordinatorSendMessage> for CoordinatorSendMessage<WireCoordinatorSendBody> { fn from(value: CoordinatorSendMessage) -> Self { CoordinatorSendMessage { target_destinations: value.target_destinations, message_body: value.message_body.into(), } } } /// Firmware upgrade protocol messages sent by coordinator to devices. /// /// ## Digest Variants /// /// There are two `PrepareUpgrade` variants that differ in which digest they send: /// /// - [`PrepareUpgrade`]: Legacy variant that sends digest of entire signed firmware /// (including signature block and padding). Used by v0.0.1 and earlier devices. /// /// - [`PrepareUpgrade2`]: New variant that sends digest of deterministic firmware only /// (excluding signature block and padding). The device displays this digest on screen, /// allowing users to verify it matches their locally-built reproducible firmware. /// /// ## Device Verification Strategy /// /// Devices accept **both** digest types during verification for backwards compatibility. /// This is cryptographically sound because: /// /// 1. SHA256 collision resistance (~2^-256 probability) makes accidental matches impossible /// 2. The two digests cover different byte ranges, requiring collision at specific boundaries /// 3. Simplifies device code - no need to track which variant was received /// 4. Provides graceful fallback if coordinator sends wrong digest type /// /// See `device/src/ota.rs::enter_upgrade_mode()` for verification implementation. #[derive(Encode, Decode, Debug, Clone)] pub enum CoordinatorUpgradeMessage { /// Legacy upgrade preparation - sends digest of entire signed firmware. /// Digest includes firmware + padding + signature block (if present). PrepareUpgrade { size: u32, firmware_digest: Sha256Digest, }, EnterUpgradeMode, /// New upgrade preparation - sends digest of deterministic firmware only. /// Digest excludes padding and signature block. Device displays this digest, /// allowing users to verify it matches their locally-built reproducible firmware. /// Placed at end of enum for bincode backwards compatibility. PrepareUpgrade2 { size: u32, firmware_digest: Sha256Digest, }, } #[derive(Encode, Decode, Debug, Clone)] pub enum NameCommand { Preview(DeviceName), Prompt(DeviceName), } impl Gist for CoordinatorSendBody { fn gist(&self) -> String { match self { CoordinatorSendBody::Core(core) => core.gist(), _ => format!("{self:?}"), } } } impl Gist for WireCoordinatorSendBody { fn gist(&self) -> String { match self { WireCoordinatorSendBody::EncapsV0(_) => "EncapsV0".into(), _ => match self.clone().decode() { Some(decoded) => decoded.gist(), None => "UNINTELLIGBLE".into(), }, } } } #[derive(Debug, Clone, Copy)] pub struct MagicBytes<O>(PhantomData<O>); impl<O> Default for MagicBytes<O> { fn default() -> Self { Self(Default::default()) } } #[derive(Clone, Copy, Debug, Default)] pub struct Upstream; #[derive(Clone, Copy, Debug, Default)] pub struct Downstream; pub trait HasMagicBytes { const MAGIC_BYTES: [u8; MAGIC_BYTES_LEN]; const VERSION_SIGNAL: MagicBytesVersion; } pub trait Direction: HasMagicBytes { type RecvType: bincode::Encode + bincode::Decode<()> + Gist; type Opposite: Direction; } impl HasMagicBytes for Upstream { const VERSION_SIGNAL: MagicBytesVersion = 0; const MAGIC_BYTES: [u8; MAGIC_BYTES_LEN] = MAGICBYTES_RECV_UPSTREAM; } impl Direction for Upstream { type RecvType = CoordinatorSendMessage<WireCoordinatorSendBody>; type Opposite = Downstream; } impl HasMagicBytes for Downstream { const VERSION_SIGNAL: MagicBytesVersion = 2; const MAGIC_BYTES: [u8; MAGIC_BYTES_LEN] = MAGICBYTES_RECV_DOWNSTREAM; } impl Direction for Downstream { type RecvType = DeviceSendMessage<WireDeviceSendBody>; type Opposite = Upstream; } impl<O: HasMagicBytes> bincode::Encode for MagicBytes<O> { fn encode<E: bincode::enc::Encoder>( &self, encoder: &mut E, ) -> Result<(), bincode::error::EncodeError> { let mut magic_bytes = O::MAGIC_BYTES; magic_bytes[magic_bytes.len() - 1] += O::VERSION_SIGNAL; encoder.writer().write(&magic_bytes) } } impl<Context, O: HasMagicBytes> bincode::Decode<Context> for MagicBytes<O> { fn decode<D: bincode::de::Decoder>( decoder: &mut D, ) -> Result<Self, bincode::error::DecodeError> { let mut bytes = [0u8; MAGIC_BYTES_LEN]; decoder.reader().read(&mut bytes)?; let expected = O::MAGIC_BYTES; let except_version_signal_byte = ..MAGIC_BYTES_LEN - 1; if bytes[except_version_signal_byte] == expected[except_version_signal_byte] { // We don't care about version signal here yet Ok(MagicBytes(PhantomData)) } else { Err(bincode::error::DecodeError::OtherString(format!( "was expecting magic bytes {:02x?} but got {:02x?}", O::MAGIC_BYTES, bytes ))) } } } #[derive(Clone, Copy, Debug, PartialEq)] pub struct DeviceSupportedFeatures { pub conch_enabled: bool, } impl DeviceSupportedFeatures { pub fn from_version(version: u8) -> Self { DeviceSupportedFeatures { conch_enabled: version == 1, } } } impl<'de, Context, O: HasMagicBytes> bincode::BorrowDecode<'de, Context> for MagicBytes<O> { fn borrow_decode<D: bincode::de::BorrowDecoder<'de>>( decoder: &mut D, ) -> core::result::Result<Self, bincode::error::DecodeError> { bincode::Decode::decode(decoder) } } /// Message sent from a device to the coordinator #[derive(Encode, Decode, Debug, Clone, PartialEq)] pub struct DeviceSendMessage<B> { pub from: DeviceId, pub body: B, } impl<B: Gist> Gist for DeviceSendMessage<B> { fn gist(&self) -> String { format!("{} <= {}", self.body.gist(), self.from) } } #[derive(Encode, Decode, Debug, Clone)] pub enum DeviceSendBody { Core(frostsnap_core::message::DeviceToCoordinatorMessage), Debug { message: String, }, Announce { firmware_digest: Sha256Digest, }, SetName { name: DeviceName, }, DisconnectDownstream, NeedName, _LegacyAckUpgradeMode, // Used by earliest devices Misc(CommsMisc), SignedChallenge { signature: Box<[u8; 384]>, certificate: Box<Certificate>, }, } #[derive(Encode, Decode, Debug, Clone)] pub enum CommsMisc { /// A device has ack'd going into upgrade mode. AckUpgradeMode, /// Tells the coordinator that a device has confirmed to show it's backup. /// core doesn't provide a way to tell the coordinator that showing the backup was confirmed so /// we have this here. /// DEPRECATED: Use BackupRecorded instead. DisplayBackupConfrimed, /// Tells the coordinator that the user has confirmed they recorded the backup. /// This is sent after the user completes the final "Backup recorded?" hold-to-confirm. BackupRecorded, } impl Gist for CommsMisc { fn gist(&self) -> String { format!("{self:?}") } } #[derive(Encode, Decode, Debug, Clone, PartialEq)] pub enum WireDeviceSendBody { _Core, Debug { message: String }, Announce { firmware_digest: Sha256Digest }, SetName { name: DeviceName }, DisconnectDownstream, NeedName, _LegacyAckUpgradeMode, // Used by earliest devices EncapsV0(EncapsBody), } impl Gist for WireDeviceSendBody { fn gist(&self) -> String { match self { WireDeviceSendBody::EncapsV0(_) => "EncapsV0(..)".into(), _ => self.clone().decode().expect("infallible").gist(), } } } impl From<DeviceSendBody> for WireDeviceSendBody { fn from(value: DeviceSendBody) -> Self { let encaps = bincode::encode_to_vec(value, BINCODE_CONFIG).expect("encoding works"); WireDeviceSendBody::EncapsV0(EncapsBody(encaps)) } } impl From<DeviceSendMessage<DeviceSendBody>> for DeviceSendMessage<WireDeviceSendBody> { fn from(value: DeviceSendMessage<DeviceSendBody>) -> Self { DeviceSendMessage { from: value.from, body: value.body.into(), } } } impl WireDeviceSendBody { pub fn decode(self) -> Result<DeviceSendBody, bincode::error::DecodeError> { Ok(match self { WireDeviceSendBody::_Core => { return Err(bincode::error::DecodeError::Other( "core messages should never be sent here", )); } WireDeviceSendBody::Debug { message } => DeviceSendBody::Debug { message }, WireDeviceSendBody::Announce { firmware_digest } => { DeviceSendBody::Announce { firmware_digest } } WireDeviceSendBody::SetName { name } => DeviceSendBody::SetName { name }, WireDeviceSendBody::DisconnectDownstream => DeviceSendBody::DisconnectDownstream, WireDeviceSendBody::NeedName => DeviceSendBody::NeedName, WireDeviceSendBody::_LegacyAckUpgradeMode => DeviceSendBody::_LegacyAckUpgradeMode, WireDeviceSendBody::EncapsV0(encaps) => { let (msg, _) = bincode::decode_from_slice(encaps.0.as_ref(), BINCODE_CONFIG)?; msg } }) } } impl Gist for DeviceSendBody { fn gist(&self) -> String { match self { DeviceSendBody::Core(msg) => msg.gist(), DeviceSendBody::Debug { message } => format!("debug: {message}"), _ => format!("{self:?}"), } } } pub type MagicBytesVersion = u8; pub fn make_progress_on_magic_bytes<D: Direction>( remaining: impl Iterator<Item = u8>, progress: usize, ) -> (usize, Option<MagicBytesVersion>) { let magic_bytes = D::MAGIC_BYTES; _make_progress_on_magic_bytes(remaining, &magic_bytes, progress) } fn _make_progress_on_magic_bytes( remaining: impl Iterator<Item = u8>, magic_bytes: &[u8], mut progress: usize, ) -> (usize, Option<MagicBytesVersion>) { for byte in remaining { // the last byte is used for version signaling -- doesn't need to be exact match let is_last_byte = progress == magic_bytes.len() - 1; let expected_byte = magic_bytes[progress]; if is_last_byte && byte >= expected_byte { return (0, Some(byte - expected_byte)); } else if byte == expected_byte { progress += 1; } else { progress = 0; } } (progress, None) } pub fn find_and_remove_magic_bytes<D: Direction>(buff: &mut Vec<u8>) -> Option<MagicBytesVersion> { let magic_bytes = D::MAGIC_BYTES; _find_and_remove_magic_bytes(buff, &magic_bytes[..]) } fn _find_and_remove_magic_bytes( buff: &mut Vec<u8>, magic_bytes: &[u8], ) -> Option<MagicBytesVersion> { let mut consumed = 0; let (_, found) = _make_progress_on_magic_bytes( buff.iter().cloned().inspect(|_| consumed += 1), magic_bytes, 0, ); if found.is_some() { *buff = buff.split_off(consumed); } found } #[derive(Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)] pub struct Sha256Digest(pub [u8; 32]); frostsnap_core::impl_display_debug_serialize! { fn to_bytes(digest: &Sha256Digest) -> [u8;32] { digest.0 } } frostsnap_core::impl_fromstr_deserialize! { name => "sha256 digest", fn from_bytes(bytes: [u8;32]) -> Sha256Digest { Sha256Digest(bytes) } } #[cfg(test)] mod test { use super::*; #[test] fn remove_magic_bytes() { let mut bytes = b"hello world".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), None); let mut bytes = b"hello magic world".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), Some(0)); assert_eq!(bytes, b" world"); let mut bytes = b"hello magicmagic world".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), Some(0)); assert_eq!(bytes, b"magic world"); let mut bytes = b"magic".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), Some(0)); assert_eq!(bytes, b""); let mut bytes = b"hello magid world".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), Some(1)); let mut bytes = b"hello magif world".to_vec(); assert_eq!(_find_and_remove_magic_bytes(&mut bytes, b"magic"), Some(3)); } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/fixed_string.rs
frostsnap_comms/src/fixed_string.rs
use alloc::string::{String, ToString}; use core::fmt; use core::ops::Deref; use core::str::FromStr; #[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct FixedString<const N: usize> { inner: String, } #[derive(Debug, Clone, PartialEq, Eq)] pub struct StringTooLong { pub max_len: usize, pub actual_len: usize, } impl fmt::Display for StringTooLong { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "String too long: max length is {} but got {}", self.max_len, self.actual_len ) } } #[cfg(feature = "std")] impl std::error::Error for StringTooLong {} impl<const N: usize> FixedString<N> { pub fn new(s: String) -> Result<Self, StringTooLong> { let char_count = s.chars().count(); if char_count > N { Err(StringTooLong { max_len: N, actual_len: char_count, }) } else { Ok(Self { inner: s }) } } pub fn truncate(s: String) -> Self { let char_count = s.chars().count(); if char_count > N { // Truncate to N characters, respecting UTF-8 boundaries let truncated: String = s.chars().take(N).collect(); Self { inner: truncated } } else { Self { inner: s } } } pub fn as_str(&self) -> &str { &self.inner } pub fn into_string(self) -> String { self.inner } pub fn max_length() -> usize { N } pub fn len(&self) -> usize { self.inner.chars().count() } pub fn is_empty(&self) -> bool { self.inner.is_empty() } } impl<const N: usize> Deref for FixedString<N> { type Target = String; fn deref(&self) -> &Self::Target { &self.inner } } impl<const N: usize> AsRef<str> for FixedString<N> { fn as_ref(&self) -> &str { &self.inner } } impl<const N: usize> fmt::Display for FixedString<N> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&self.inner, f) } } impl<const N: usize> TryFrom<String> for FixedString<N> { type Error = StringTooLong; fn try_from(value: String) -> Result<Self, Self::Error> { Self::new(value) } } impl<const N: usize> FromStr for FixedString<N> { type Err = StringTooLong; fn from_str(s: &str) -> Result<Self, Self::Err> { Self::new(s.to_string()) } } impl<const N: usize> TryFrom<&str> for FixedString<N> { type Error = StringTooLong; fn try_from(value: &str) -> Result<Self, Self::Error> { Self::from_str(value) } } impl<const N: usize> Default for FixedString<N> { fn default() -> Self { Self { inner: String::new(), } } } impl<const N: usize> bincode::Encode for FixedString<N> { fn encode<E: bincode::enc::Encoder>( &self, encoder: &mut E, ) -> Result<(), bincode::error::EncodeError> { self.inner.encode(encoder) } } impl<const N: usize, Context> bincode::Decode<Context> for FixedString<N> { fn decode<D: bincode::de::Decoder>( decoder: &mut D, ) -> Result<Self, bincode::error::DecodeError> { let s = String::decode(decoder)?; // Truncate if too long instead of returning an error Ok(Self::truncate(s)) } } impl<'de, const N: usize, C> bincode::BorrowDecode<'de, C> for FixedString<N> { fn borrow_decode<D: bincode::de::BorrowDecoder<'de>>( decoder: &mut D, ) -> Result<Self, bincode::error::DecodeError> { let s = String::borrow_decode(decoder)?; Ok(Self::truncate(s)) } } pub const DEVICE_NAME_MAX_LENGTH: usize = 14; pub const KEY_NAME_MAX_LENGTH: usize = 15; pub type DeviceName = FixedString<DEVICE_NAME_MAX_LENGTH>; #[cfg(test)] mod tests { use super::*; #[test] fn test_fixed_string_creation() { let s = FixedString::<10>::from_str("hello").unwrap(); assert_eq!(s.as_str(), "hello"); assert_eq!(s.len(), 5); let err = FixedString::<3>::from_str("hello").unwrap_err(); assert_eq!(err.max_len, 3); assert_eq!(err.actual_len, 5); } #[test] fn test_truncate() { let s = FixedString::<3>::truncate("hello".to_string()); assert_eq!(s.as_str(), "hel"); } #[test] fn test_bincode_roundtrip() { let s = FixedString::<10>::from_str("test").unwrap(); let encoded = bincode::encode_to_vec(&s, bincode::config::standard()).unwrap(); let decoded: FixedString<10> = bincode::decode_from_slice(&encoded, bincode::config::standard()) .unwrap() .0; assert_eq!(decoded, s); } #[test] fn test_bincode_decode_too_long() { let s = "hello world this is too long"; let encoded = bincode::encode_to_vec(s, bincode::config::standard()).unwrap(); let result: FixedString<10> = bincode::decode_from_slice(&encoded, bincode::config::standard()) .unwrap() .0; // Should truncate to 10 characters assert_eq!(result.as_str(), "hello worl"); } #[test] fn test_unicode_character_counting() { // Test with emoji and non-ASCII characters let emoji_string = "Hello 👋 世界".to_string(); // This string has 10 characters: H-e-l-l-o-space-👋-space-世-界 assert_eq!(emoji_string.chars().count(), 10); assert!(emoji_string.len() > 10); // More bytes than characters let fixed = FixedString::<10>::new(emoji_string.clone()).unwrap(); assert_eq!(fixed.len(), 10); assert_eq!(fixed.as_str(), "Hello 👋 世界"); // Test truncation with Unicode let long_unicode = "Hello 👋 世界 🎉 Test".to_string(); let truncated = FixedString::<8>::truncate(long_unicode); assert_eq!(truncated.len(), 8); assert_eq!(truncated.as_str(), "Hello 👋 "); // Test "ServerRoomCafé" which has 14 characters (the é is one character) let server_room = "ServerRoomCafé".to_string(); assert_eq!(server_room.chars().count(), 14); let server_fixed = FixedString::<14>::new(server_room.clone()).unwrap(); assert_eq!(server_fixed.len(), 14); assert_eq!(server_fixed.as_str(), "ServerRoomCafé"); } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/firmware_reader.rs
frostsnap_comms/src/firmware_reader.rs
//! # Firmware Reading and Parsing //! //! This module provides a trait-based abstraction for reading firmware from different sources //! (flash partitions on devices, or in-memory buffers on coordinators) and parsing ESP32 //! firmware image format. use crate::SIGNATURE_BLOCK_MAGIC; use alloc::boxed::Box; use alloc::string::String; pub const SECTOR_SIZE: usize = 4096; /// Trait for reading firmware data sector-by-sector pub trait FirmwareReader { type Error: core::fmt::Debug; fn read_sector(&self, sector: u32) -> Result<Box<[u8; SECTOR_SIZE]>, Self::Error>; fn n_sectors(&self) -> u32; } #[derive(Debug, Clone, Copy)] #[repr(C, packed)] struct ImageHeader { magic: u8, segment_count: u8, flash_mode: u8, flash_config: u8, entry: u32, // extended header part wp_pin: u8, clk_q_drv: u8, d_cs_drv: u8, gd_wp_drv: u8, chip_id: u16, min_rev: u8, min_chip_rev_full: u16, max_chip_rev_full: u16, reserved: [u8; 4], append_digest: u8, } #[derive(Debug, Clone, Copy)] #[repr(C, packed)] struct SegmentHeader { addr: u32, length: u32, } #[derive(Debug, Clone)] pub enum FirmwareSizeError { IoError(String), InvalidMagic(u8), InvalidHeaderSize, InvalidSegmentCount(u8), SegmentTooLarge(u32), SectorOutOfBounds(u32), CorruptedSegmentHeader, } impl core::fmt::Display for FirmwareSizeError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { FirmwareSizeError::IoError(msg) => write!(f, "I/O error: {}", msg), FirmwareSizeError::InvalidMagic(magic) => write!( f, "Invalid firmware header magic: 0x{:02X}, expected 0xE9", magic ), FirmwareSizeError::InvalidHeaderSize => write!(f, "Firmware header too small"), FirmwareSizeError::InvalidSegmentCount(count) => { write!(f, "Invalid segment count: {}", count) } FirmwareSizeError::SegmentTooLarge(size) => { write!(f, "Segment size too large: {} bytes", size) } FirmwareSizeError::SectorOutOfBounds(sector) => { write!(f, "Sector {} is out of bounds", sector) } FirmwareSizeError::CorruptedSegmentHeader => write!(f, "Corrupted segment header"), } } } // Constants from espflash pub const ESP_MAGIC: u8 = 0xE9; pub const HEADER_SIZE: usize = core::mem::size_of::<ImageHeader>(); pub const SEGMENT_HEADER_SIZE: usize = core::mem::size_of::<SegmentHeader>(); pub const MAX_SEGMENTS: u8 = 16; pub const MAX_SEGMENT_SIZE: u32 = 16 * 1024 * 1024; // 16MB /// Find the signature sector in firmware pub fn find_signature_sector<R: FirmwareReader>(reader: &R) -> Option<u32> { for i in (0..reader.n_sectors()).rev() { match reader.read_sector(i) { Ok(sector_data) => { if sector_data.len() >= 4 && sector_data[0..4] == SIGNATURE_BLOCK_MAGIC { return Some(i); } } Err(_) => continue, } } None } /// Calculate the actual size of ESP32 firmware. /// /// Returns a tuple: /// - First value: Size of firmware content only (header + segments + padding + digest) /// - Second value: Total size including Secure Boot v2 signature blocks if present pub fn firmware_size<R: FirmwareReader>(reader: &R) -> Result<(u32, u32), FirmwareSizeError> { let first_sector_array = reader .read_sector(0) .map_err(|e| FirmwareSizeError::IoError(format!("Failed to read first sector: {:?}", e)))?; let first_sector = &first_sector_array[..]; if first_sector.len() < HEADER_SIZE { return Err(FirmwareSizeError::InvalidHeaderSize); } let header = ImageHeader { magic: first_sector[0], segment_count: first_sector[1], flash_mode: first_sector[2], flash_config: first_sector[3], entry: u32::from_le_bytes([ first_sector[4], first_sector[5], first_sector[6], first_sector[7], ]), wp_pin: first_sector[8], clk_q_drv: first_sector[9], d_cs_drv: first_sector[10], gd_wp_drv: first_sector[11], chip_id: u16::from_le_bytes([first_sector[12], first_sector[13]]), min_rev: first_sector[14], min_chip_rev_full: u16::from_le_bytes([first_sector[15], first_sector[16]]), max_chip_rev_full: u16::from_le_bytes([first_sector[17], first_sector[18]]), reserved: [ first_sector[19], first_sector[20], first_sector[21], first_sector[22], ], append_digest: first_sector[23], }; if header.magic != ESP_MAGIC { return Err(FirmwareSizeError::InvalidMagic(header.magic)); } if header.segment_count == 0 || header.segment_count > MAX_SEGMENTS { return Err(FirmwareSizeError::InvalidSegmentCount(header.segment_count)); } let mut current_pos = HEADER_SIZE as u32; let mut max_data_end = current_pos; for _segment_idx in 0..header.segment_count { let segment_header = read_segment_header_safe(reader, current_pos)?; if segment_header.length > MAX_SEGMENT_SIZE { return Err(FirmwareSizeError::SegmentTooLarge(segment_header.length)); } let segment_data_end = current_pos .checked_add(SEGMENT_HEADER_SIZE as u32) .and_then(|pos| pos.checked_add(segment_header.length)) .ok_or(FirmwareSizeError::CorruptedSegmentHeader)?; max_data_end = max_data_end.max(segment_data_end); current_pos = segment_data_end; } let unpadded_length = max_data_end; let length_with_checksum = unpadded_length + 1; let padded_length = (length_with_checksum + 15) & !15; let mut firmware_end = padded_length; if header.append_digest == 1 { firmware_end = firmware_end .checked_add(32) .ok_or(FirmwareSizeError::CorruptedSegmentHeader)?; } if let Some(signature_sector) = find_signature_sector(reader) { let total_size = (signature_sector + 1) * (SECTOR_SIZE as u32); Ok((firmware_end, total_size)) } else { Ok((firmware_end, firmware_end)) } } fn read_segment_header_safe<R: FirmwareReader>( reader: &R, pos: u32, ) -> Result<SegmentHeader, FirmwareSizeError> { let sector_size = SECTOR_SIZE as u32; let sector_num = pos / sector_size; let sector_offset = (pos % sector_size) as usize; if sector_num >= reader.n_sectors() { return Err(FirmwareSizeError::SectorOutOfBounds(sector_num)); } let sector = reader.read_sector(sector_num).map_err(|e| { FirmwareSizeError::IoError(format!("Failed to read sector for segment header: {:?}", e)) })?; if sector_offset + SEGMENT_HEADER_SIZE <= sector.len() { let end_pos = sector_offset + SEGMENT_HEADER_SIZE; Ok(parse_segment_header(&sector[sector_offset..end_pos])) } else { let mut header_bytes = [0u8; SEGMENT_HEADER_SIZE]; let first_part = sector.len().saturating_sub(sector_offset); if first_part > 0 && sector_offset < sector.len() { header_bytes[..first_part].copy_from_slice(&sector[sector_offset..]); } if first_part < SEGMENT_HEADER_SIZE { let next_sector_num = sector_num + 1; if next_sector_num >= reader.n_sectors() { return Err(FirmwareSizeError::SectorOutOfBounds(next_sector_num)); } let next_sector = reader.read_sector(next_sector_num).map_err(|e| { FirmwareSizeError::IoError(format!( "Failed to read next sector for spanning segment header: {:?}", e )) })?; let remaining = SEGMENT_HEADER_SIZE - first_part; if remaining <= next_sector.len() { header_bytes[first_part..].copy_from_slice(&next_sector[..remaining]); } else { return Err(FirmwareSizeError::CorruptedSegmentHeader); } } Ok(parse_segment_header(&header_bytes)) } } fn parse_segment_header(bytes: &[u8]) -> SegmentHeader { SegmentHeader { addr: u32::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]), length: u32::from_le_bytes([bytes[4], bytes[5], bytes[6], bytes[7]]), } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/factory.rs
frostsnap_comms/src/factory.rs
use crate::{ genuine_certificate::Certificate, Direction, HasMagicBytes, MagicBytesVersion, MAGIC_BYTES_LEN, }; use alloc::{string::String, vec::Vec}; use frostsnap_core::Gist; pub const DS_KEY_SIZE_BITS: usize = 3072; pub const DS_KEY_SIZE_BYTES: usize = DS_KEY_SIZE_BITS / 8; pub fn pad_message_for_rsa(message_digest: &[u8]) -> [u8; DS_KEY_SIZE_BYTES] { // Hard-code the ASN.1 DigestInfo prefix for SHA-256 const SHA256_ASN1_PREFIX: &[u8] = &[ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20, ]; let mut padded_block = [0; DS_KEY_SIZE_BYTES]; // PKCS#1 v1.5 format: 0x00 || 0x01 || PS || 0x00 || T padded_block[0] = 0x00; padded_block[1] = 0x01; // Calculate padding length let padding_len = DS_KEY_SIZE_BYTES - SHA256_ASN1_PREFIX.len() - message_digest.len() - 3; // Fill with 0xFF bytes for i in 0..padding_len { padded_block[2 + i] = 0xFF; } // Add 0x00 separator padded_block[2 + padding_len] = 0x00; // Add prefix (ASN.1 DigestInfo) let prefix_offset = 3 + padding_len; padded_block[prefix_offset..(prefix_offset + SHA256_ASN1_PREFIX.len())] .copy_from_slice(SHA256_ASN1_PREFIX); // Add message digest let digest_offset = prefix_offset + SHA256_ASN1_PREFIX.len(); padded_block[digest_offset..(digest_offset + message_digest.len())] .copy_from_slice(message_digest); padded_block } #[derive(Debug, Clone)] pub struct FactoryUpstream; #[derive(Debug, Clone)] pub struct FactoryDownstream; #[derive(bincode::Encode, bincode::Decode, Debug, Clone)] #[allow(clippy::large_enum_variant)] // only once during factory pub enum DeviceFactorySend { InitEntropyOk, ReceivedDsKey, } #[derive(bincode::Encode, bincode::Decode, Debug, Clone)] #[allow(clippy::large_enum_variant)] // only once during factory pub enum FactorySend { CheckState, InitEntropy([u8; 32]), SetEsp32DsKey(Esp32DsKey), SetGenuineCertificate(Certificate), } #[derive(bincode::Encode, bincode::Decode, Debug, Clone)] pub struct Esp32DsKey { pub encrypted_params: Vec<u8>, pub ds_hmac_key: [u8; 32], } impl Gist for DeviceFactorySend { fn gist(&self) -> String { match self { DeviceFactorySend::InitEntropyOk => "InitEntropyOk", DeviceFactorySend::ReceivedDsKey => "SetDs", } .into() } } impl Gist for FactorySend { fn gist(&self) -> String { match self { FactorySend::CheckState => "CheckState", FactorySend::SetEsp32DsKey { .. } => "SetEsp32DsKey", FactorySend::InitEntropy(_) => "InitEntropy", FactorySend::SetGenuineCertificate(_) => "GenuineCertificate", } .into() } } impl HasMagicBytes for FactoryUpstream { const MAGIC_BYTES: [u8; MAGIC_BYTES_LEN] = *b"factup0"; const VERSION_SIGNAL: MagicBytesVersion = 0; } impl Direction for FactoryUpstream { type RecvType = FactorySend; type Opposite = FactoryDownstream; } impl Direction for FactoryDownstream { type RecvType = DeviceFactorySend; type Opposite = FactoryUpstream; } impl HasMagicBytes for FactoryDownstream { const MAGIC_BYTES: [u8; MAGIC_BYTES_LEN] = *b"factdn0"; const VERSION_SIGNAL: MagicBytesVersion = 0; }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/db.rs
frostsnap_factory/src/db.rs
use frostsnap_comms::Sha256Digest; use mysql::prelude::*; use mysql::{Pool, PooledConn}; use std::time::SystemTime; pub struct Database { pool: Pool, } impl Database { pub fn new(db_connection: String) -> Result<Self, Box<dyn std::error::Error>> { let opts = mysql::Opts::from_url(&db_connection)?; let pool = Pool::new(opts)?; let mut conn = pool.get_conn()?; conn.query_drop( "CREATE TABLE IF NOT EXISTS devices ( id INT AUTO_INCREMENT PRIMARY KEY, operator VARCHAR(255) NOT NULL, factory_completed_at BIGINT NOT NULL, case_color VARCHAR(50) NOT NULL, serial_number VARCHAR(255) UNIQUE NOT NULL, board_revision VARCHAR(50) NOT NULL, firmware_hash VARCHAR(64), genuine_verified BOOLEAN DEFAULT FALSE, status ENUM('factory_complete', 'genuine_verified', 'failed'), failure_reason TEXT, batch_note TEXT )", )?; conn.query_drop( "CREATE TABLE IF NOT EXISTS serial_counter ( id INT PRIMARY KEY, current_serial INT NOT NULL DEFAULT 00001000, CHECK (id = 1) )", )?; conn.query_drop( "INSERT IGNORE INTO serial_counter (id, current_serial) VALUES (1, 00001000)", )?; Ok(Database { pool }) } fn get_conn(&self) -> mysql::Result<PooledConn> { self.pool.get_conn() } /// Mark a device as factory complete - should only happen once per serial pub fn mark_factory_complete( &self, serial_number: &str, color: &str, operator: &str, board_revision: &str, batch_note: Option<&str>, ) -> Result<(), Box<dyn std::error::Error>> { let timestamp = SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() .as_secs() as i64; let mut conn = self.get_conn()?; conn.exec_drop( "INSERT INTO devices (serial_number, case_color, operator, factory_completed_at, status, board_revision, batch_note) VALUES (?, ?, ?, ?, 'factory_complete', ?, ?)", (serial_number, color, operator, timestamp, board_revision, batch_note), )?; Ok(()) } pub fn mark_genuine_verified( &self, serial_number: &str, firmware_digest: Sha256Digest, ) -> Result<(), Box<dyn std::error::Error>> { let mut conn = self.get_conn()?; let exists: Option<u8> = conn.exec_first( "SELECT 1 FROM devices WHERE serial_number = ?", (serial_number,), )?; if exists.is_none() { return Err(format!("Serial number {} not found in database", serial_number).into()); } // Allow genuine checks to succeed again conn.exec_drop( "UPDATE devices SET firmware_hash = ?, genuine_verified = TRUE, status = 'genuine_verified' WHERE serial_number = ?", (firmware_digest.to_string(), serial_number), )?; Ok(()) } /// Mark a device as failed pub fn mark_failed( &self, serial_number: &str, color: &str, operator: &str, board_revision: &str, reason: &str, batch_note: Option<&str>, ) -> Result<(), Box<dyn std::error::Error>> { let timestamp = SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() .as_secs() as i64; let mut conn = self.get_conn()?; // Try insert first, then update if it fails due to constraint match conn.exec_drop( "INSERT INTO devices (serial_number, case_color, operator, factory_completed_at, status, board_revision, failure_reason, batch_note) VALUES (?, ?, ?, ?, 'failed', ?, ?, ?)", (serial_number, color, operator, timestamp, board_revision, reason, batch_note), ) { Ok(_) => Ok(()), Err(_) => { // Device exists, update it conn.exec_drop( "UPDATE devices SET status = 'failed', failure_reason = ? WHERE serial_number = ?", (reason, serial_number), )?; Ok(()) } } } pub fn get_next_serial(&self) -> Result<u32, Box<dyn std::error::Error>> { let mut conn = self.get_conn()?; let mut tx = conn.start_transaction(mysql::TxOpts::default())?; let current: u32 = tx .query_first("SELECT current_serial FROM serial_counter WHERE id = 1")? .ok_or("Serial counter row not found!?")?; let next = current + 1; tx.exec_drop( "UPDATE serial_counter SET current_serial = ? WHERE id = 1", (next,), )?; tx.commit()?; Ok(next) } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/process.rs
frostsnap_factory/src/process.rs
use frostsnap_comms::factory::{DeviceFactorySend, FactoryDownstream, FactorySend}; use frostsnap_comms::genuine_certificate::CertificateVerifier; use frostsnap_comms::{ CoordinatorSendBody, CoordinatorSendMessage, DeviceSendBody, Direction, Downstream, ReceiveSerial, Sha256Digest, MAGIC_BYTES_PERIOD, }; use frostsnap_coordinator::{DesktopSerial, FramedSerialPort, Serial}; use frostsnap_core::schnorr_fun; use frostsnap_core::schnorr_fun::fun::marker::EvenY; use frostsnap_core::schnorr_fun::fun::Point; use frostsnap_core::sha2; use frostsnap_core::sha2::Sha256; use hmac::digest::Digest; use rand::rngs::ThreadRng; use rand::{CryptoRng, RngCore}; use rsa::pkcs1::{DecodeRsaPublicKey, EncodeRsaPublicKey}; use rsa::RsaPublicKey; use std::collections::HashMap; use std::time::{self, Instant}; use tracing::*; use crate::{ds, FactoryState}; const USB_VID: u16 = 12346; const USB_PID: u16 = 4097; #[derive(Debug)] enum FactoryResult { Continue, SwitchToMain, FactoryComplete(String), GenuineComplete(String, Sha256Digest), // serial number, firmware_digest, FinishedAndDisconnected, Failed(Option<String>, String), // serial number (if known), reason } enum AnyConnection { Factory(Connection<FactoryDownstream>), Main(Connection<Downstream>), } struct Connection<T: Direction> { state: ConnectionState, port: FramedSerialPort<T>, last_activity: Instant, } enum ConnectionState { // Factory states WaitingForFactoryMagic { last_wrote: Option<Instant>, attempts: usize, }, BeginInitEntropy { provisioned_serial: String, }, InitEntropy { provisioned_serial: String, }, SettingDsKey { ds_public_key: RsaPublicKey, provisioned_serial: String, }, FactoryDone { serial: String, }, // Main states WaitingForMainMagic { last_wrote: Option<Instant>, }, WaitingForAnnounce, ProcessingGenuineCheck { firmware_digest: Sha256Digest, challenge: Box<[u8; 32]>, }, GenuineVerified { firmware_digest: Sha256Digest, serial: String, }, // Fully finished AwaitingDisconnection, } impl<T: Direction> Connection<T> { fn new(port: FramedSerialPort<T>, initial_state: ConnectionState) -> Self { Self { state: initial_state, port, last_activity: Instant::now(), } } } pub fn run_with_state(factory_state: &mut FactoryState) -> ! { tracing_subscriber::fmt().pretty().init(); let desktop_serial = DesktopSerial; let mut rng = rand::thread_rng(); let mut connections: HashMap<String, AnyConnection> = HashMap::new(); loop { // Scan for new devices for port_desc in desktop_serial.available_ports() { if connections.contains_key(&port_desc.id) { continue; // Already handling this port } if port_desc.vid != USB_VID || port_desc.pid != USB_PID { continue; } // Start all new connections as factory - let state machine determine actual type if let Ok(port) = desktop_serial.open_device_port(&port_desc.id, 2000) { info!("Device connected: {}", port_desc.id); connections.insert( port_desc.id.clone(), AnyConnection::Factory(Connection::new( FramedSerialPort::<FactoryDownstream>::new(port), ConnectionState::WaitingForFactoryMagic { last_wrote: None, attempts: 0, }, )), ); } } // Process all connections let mut connection_results = HashMap::new(); for (port_id, connection) in connections.iter_mut() { let result = info_span!("polling port", port = port_id.to_string()).in_scope( || match connection { AnyConnection::Factory(conn) => { process_factory_connection(conn, factory_state, &mut rng) } AnyConnection::Main(conn) => process_main_connection(conn), }, ); connection_results.insert(port_id.clone(), result); } // Handle results for (port_id, result) in connection_results { match result { FactoryResult::SwitchToMain => { info!("Switching device {} to main mode", port_id); // Remove factory connection and create main connection connections.remove(&port_id); // Wait a moment for device to settle after reboot std::thread::sleep(std::time::Duration::from_millis(500)); if let Ok(port) = desktop_serial.open_device_port(&port_id, 2000) { connections.insert( port_id, AnyConnection::Main(Connection::new( FramedSerialPort::<frostsnap_comms::Downstream>::new(port), ConnectionState::WaitingForMainMagic { last_wrote: None }, )), ); info!("Successfully created main connection"); } else { error!("Failed to reopen port {} for main mode", port_id); } } FactoryResult::FactoryComplete(serial) => { println!("Device {serial} completed factory setup!"); if let Err(e) = factory_state.record_success(&serial) { error!("Failed to record success for {}: {}", serial, e); } factory_state.print_progress(); // Remove the connection - device will reboot and reconnect as main connections.remove(&port_id); info!( "Removed factory connection for {}, waiting for device reboot", port_id ); } FactoryResult::GenuineComplete(serial, firmware_digest) => { println!("Device {serial} passed genuine verification!"); if let Err(e) = factory_state.record_genuine_verified(&serial, firmware_digest) { error!( "Failed to record genuine verification for {}: {}", serial, e ); } factory_state.print_progress(); // We can't immediately remove the port, or it will reopen and restart process // we need to wait for a disconnect. // connections.remove(&port_id); // Check if batch is complete if factory_state.is_complete() { println!("Batch complete! All devices factory setup + genuine verified"); std::process::exit(0); } } FactoryResult::Failed(serial, reason) => { println!("Device {:?} failed: {reason}", serial); if let Some(serial) = serial { if let Err(e) = factory_state.record_failure(&serial, &reason) { error!("Failed to record failure for {}: {}", serial, e); } } connections.remove(&port_id); } FactoryResult::FinishedAndDisconnected => { connections.remove(&port_id); } FactoryResult::Continue => { // Keep processing this connection } } } std::thread::sleep(std::time::Duration::from_millis(50)); } } fn process_factory_connection( connection: &mut Connection<FactoryDownstream>, factory_state: &FactoryState, rng: &mut (impl RngCore + CryptoRng), ) -> FactoryResult { connection.last_activity = Instant::now(); match &connection.state { ConnectionState::WaitingForFactoryMagic { last_wrote, attempts, } => { if let Ok(supported_features) = connection.port.read_for_magic_bytes() { match supported_features { Some(_) => { let provisioned_serial = factory_state.db.get_next_serial().unwrap().to_string(); connection.state = ConnectionState::BeginInitEntropy { provisioned_serial }; } None => { if last_wrote.is_none() || last_wrote.as_ref().unwrap().elapsed().as_millis() as u64 > MAGIC_BYTES_PERIOD { if *attempts > 5 { return FactoryResult::SwitchToMain; } connection.state = ConnectionState::WaitingForFactoryMagic { last_wrote: Some(Instant::now()), attempts: *attempts + 1, }; let _ = connection.port.write_magic_bytes().inspect_err(|_| { // error!(error = e.to_string(), "failed to write magic bytes"); }); } } } } FactoryResult::Continue } ConnectionState::BeginInitEntropy { provisioned_serial } => { let mut bytes = [0u8; 32]; rng.fill_bytes(&mut bytes); match connection .port .raw_send(ReceiveSerial::Message(FactorySend::InitEntropy(bytes))) { Ok(_) => { connection.state = ConnectionState::InitEntropy { provisioned_serial: provisioned_serial.clone(), }; } Err(e) => { return FactoryResult::Failed( Some(provisioned_serial.to_string()), format!("Init entropy failed: {}", e), ); } } FactoryResult::Continue } ConnectionState::InitEntropy { provisioned_serial } => { match connection.port.try_read_message() { Ok(Some(ReceiveSerial::Message(DeviceFactorySend::InitEntropyOk))) => { let (ds_private_key, hmac_key) = ds::generate(rng); let esp32_ds_key = ds::esp32_ds_key_from_keys(&ds_private_key, hmac_key); let ds_public_key = ds_private_key.to_public_key(); match connection.port.raw_send(ReceiveSerial::Message( FactorySend::SetEsp32DsKey(esp32_ds_key), )) { Ok(_) => { connection.state = ConnectionState::SettingDsKey { ds_public_key, provisioned_serial: provisioned_serial.clone(), }; } Err(e) => { return FactoryResult::Failed( Some(provisioned_serial.to_string()), format!("DS key send failed: {}", e), ); } } } Ok(_) => {} // Keep waiting Err(e) => { return FactoryResult::Failed( Some(provisioned_serial.to_string()), format!("Read error: {}", e), ); } } FactoryResult::Continue } ConnectionState::SettingDsKey { ds_public_key, provisioned_serial, } => { match connection.port.try_read_message() { Ok(Some(ReceiveSerial::Message(DeviceFactorySend::ReceivedDsKey))) => { let rsa_der_bytes = ds_public_key.to_pkcs1_der().unwrap().to_vec(); let schnorr = schnorr_fun::new_with_synthetic_nonces::<Sha256, ThreadRng>(); let timestamp = time::SystemTime::now() .duration_since(time::UNIX_EPOCH) .expect("Time went backwards") .as_secs(); let genuine_certificate = CertificateVerifier::sign( schnorr, rsa_der_bytes, factory_state.target_color, factory_state.revision.clone(), provisioned_serial.to_string(), timestamp, factory_state.factory_keypair, ); match connection.port.raw_send(ReceiveSerial::Message( FactorySend::SetGenuineCertificate(genuine_certificate), )) { Ok(_) => { connection.state = ConnectionState::FactoryDone { serial: provisioned_serial.to_string(), }; } Err(e) => { return FactoryResult::Failed( Some(provisioned_serial.to_string()), format!("Certificate send failed: {}", e), ); } } } Ok(_) => {} // Keep waiting Err(e) => { return FactoryResult::Failed( Some(provisioned_serial.to_string()), format!("Read error: {}", e), ); } } FactoryResult::Continue } ConnectionState::FactoryDone { serial } => FactoryResult::FactoryComplete(serial.clone()), _ => FactoryResult::Continue, } } fn process_main_connection(connection: &mut Connection<Downstream>) -> FactoryResult { connection.last_activity = Instant::now(); if let Err(e) = connection.port.poll_send() { // we only care about send failures if we're not waiting for a disconnect (conch keeps going) if !matches!(connection.state, ConnectionState::AwaitingDisconnection) { return FactoryResult::Failed(None, format!("Lost communication with device {}", e)); } }; match &connection.state { ConnectionState::WaitingForMainMagic { last_wrote } => { match connection.port.read_for_magic_bytes() { Ok(supported_features) => match supported_features { Some(features) => { connection.port.set_conch_enabled(features.conch_enabled); // println!("Read device magic bytes"); connection.state = ConnectionState::WaitingForAnnounce; FactoryResult::Continue } None => { if last_wrote.is_none() || last_wrote.as_ref().unwrap().elapsed().as_millis() as u64 > MAGIC_BYTES_PERIOD { connection.state = ConnectionState::WaitingForMainMagic { last_wrote: Some(Instant::now()), }; // println!("Writing MAIN magic bytes"); let _ = connection.port.write_magic_bytes().inspect_err(|e| { error!(error = e.to_string(), "failed to write main magic bytes"); }); } FactoryResult::Continue } }, Err(e) => { error!(error = e.to_string(), "failed to read main magic bytes"); FactoryResult::Continue } } } ConnectionState::WaitingForAnnounce => { match connection.port.try_read_message() { Ok(Some(ReceiveSerial::Message(msg))) => { if let Ok(DeviceSendBody::Announce { firmware_digest }) = msg.body.decode() { // first, reply with announce ack connection.port.queue_send( CoordinatorSendMessage::to(msg.from, CoordinatorSendBody::AnnounceAck) .into(), ); let mut challenge = [0u8; 32]; rand::thread_rng().fill_bytes(&mut challenge); connection.port.queue_send( CoordinatorSendMessage::to( msg.from, CoordinatorSendBody::Challenge(Box::new(challenge)), ) .into(), ); connection.state = ConnectionState::ProcessingGenuineCheck { firmware_digest, challenge: Box::new(challenge), }; } } Ok(_) => { // Keep waiting } Err(e) => { return FactoryResult::Failed(None, format!("Read error: {}", e)); } } FactoryResult::Continue } ConnectionState::ProcessingGenuineCheck { challenge, firmware_digest, } => { match connection.port.try_read_message() { Ok(Some(ReceiveSerial::Message(msg))) => { if let Ok(DeviceSendBody::SignedChallenge { signature, certificate, }) = msg.body.decode() { let factory_key: Point<EvenY> = Point::from_xonly_bytes(frostsnap_comms::FACTORY_PUBLIC_KEY).unwrap(); let certificate_body = match CertificateVerifier::verify(&certificate, factory_key) { Some(certificate_body) => certificate_body, None => { return FactoryResult::Failed( Some(certificate.unverified_raw_serial()), "genuine check failed to verify!".to_string(), ) } }; let serial = certificate_body.raw_serial(); let ds_public_key = match RsaPublicKey::from_pkcs1_der(certificate_body.ds_public_key()) { Ok(key) => key, Err(_) => { return FactoryResult::Failed( Some(certificate_body.raw_serial()), "invalid RSA key in certificate".to_string(), ); } }; let padding = rsa::Pkcs1v15Sign::new::<sha2::Sha256>(); let message_digest: [u8; 32] = sha2::Sha256::digest(challenge.as_ref()).into(); match ds_public_key.verify(padding, &message_digest, signature.as_ref()) { Ok(_) => { connection.state = ConnectionState::GenuineVerified { firmware_digest: *firmware_digest, serial: serial.to_string(), }; } Err(_) => { return FactoryResult::Failed( Some(serial.clone()), "Device failed genuine check {}!".to_string(), ); } } } } Ok(_) => {} // Keep waiting Err(e) => { return FactoryResult::Failed(None, format!("Read error: {}", e)); } } FactoryResult::Continue } ConnectionState::GenuineVerified { serial, firmware_digest, } => { let serial = serial.clone(); let firmware_digest = *firmware_digest; connection.state = ConnectionState::AwaitingDisconnection; FactoryResult::GenuineComplete(serial, firmware_digest) } ConnectionState::AwaitingDisconnection => { if connection.port.try_read_message().is_ok() { FactoryResult::Continue } else { FactoryResult::FinishedAndDisconnected } } _ => FactoryResult::Continue, } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/cli.rs
frostsnap_factory/src/cli.rs
use clap::{Parser, Subcommand}; use frostsnap_comms::genuine_certificate::CaseColor; use std::path::PathBuf; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] pub struct Args { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand, Debug)] pub enum Commands { /// Start a factory batch Batch { /// Case color #[arg(short, long)] color: CaseColor, /// Number of devices to flash #[arg(short, long)] quantity: usize, /// Operator name #[arg(short, long)] operator: String, /// Path to factory secret key file (.hex format) #[arg(short, long)] factory_secret: PathBuf, /// Connection URL to factory database #[arg(short, long)] db_connection_url: Option<String>, /// Optional batch note (e.g., "testing devices", "for Company X") #[arg(short = 'n', long)] batch_note: Option<String>, }, }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/ds.rs
frostsnap_factory/src/ds.rs
use aes::cipher::BlockEncryptMut; use aes::cipher::{block_padding::NoPadding, KeyIvInit}; use aes::Aes256; use cbc::Encryptor; use frostsnap_comms::factory::{pad_message_for_rsa, Esp32DsKey, DS_KEY_SIZE_BITS}; use frostsnap_core::sha2::{Digest, Sha256}; use hmac::{Hmac, Mac}; use num_traits::ToPrimitive; use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use rsa::traits::PublicKeyParts as _; use rsa::BigUint; use rsa::{traits::PrivateKeyParts as _, RsaPrivateKey}; use std::error::Error; use std::fmt; const DS_NUM_WORDS: usize = DS_KEY_SIZE_BITS / 32; pub fn standard_rsa_sign(priv_key: &RsaPrivateKey, message: &[u8]) -> Vec<u8> { let message_digest: [u8; 32] = Sha256::digest(message).into(); let padded_message = pad_message_for_rsa(&message_digest); raw_exponent_rsa_sign(padded_message.into(), priv_key) } fn raw_exponent_rsa_sign(padded_int: Vec<u8>, private_key: &RsaPrivateKey) -> Vec<u8> { let d = BigUint::from_bytes_be(&private_key.d().to_bytes_be()); let n = BigUint::from_bytes_be(&private_key.n().to_bytes_be()); let challenge_uint = BigUint::from_bytes_be(&padded_int); let signature_int = challenge_uint.modpow(&d, &n); signature_int.to_bytes_be() } pub fn esp32_ds_key_from_keys(priv_key: &RsaPrivateKey, hmac_key: [u8; 32]) -> Esp32DsKey { type HmacSha256 = Hmac<Sha256>; let mut mac = HmacSha256::new_from_slice(&hmac_key[..]).expect("HMAC can take key of any size"); mac.update([0xffu8; 32].as_slice()); let aes_key: [u8; 32] = mac.finalize().into_bytes().into(); let iv = [ 0xb8, 0xb4, 0x69, 0x18, 0x28, 0xa3, 0x91, 0xd9, 0xd6, 0x62, 0x85, 0x8c, 0xc9, 0x79, 0x48, 0x86, ]; let plaintext_data = EspDsPData::new(priv_key).unwrap(); let encrypted_params = encrypt_private_key_material(&plaintext_data, &aes_key[..], &iv[..]).unwrap(); Esp32DsKey { encrypted_params, ds_hmac_key: hmac_key, } } pub fn generate(rng: &mut (impl RngCore + CryptoRng)) -> (RsaPrivateKey, [u8; 32]) { let priv_key = RsaPrivateKey::new(rng, DS_KEY_SIZE_BITS).unwrap(); let mut hmac_key = [42u8; 32]; rng.fill_bytes(&mut hmac_key); (priv_key, hmac_key) } #[repr(C)] pub struct EspDsPData { pub y: [u32; DS_NUM_WORDS], // RSA exponent (private exponent) pub m: [u32; DS_NUM_WORDS], // RSA modulus pub rb: [u32; DS_NUM_WORDS], // Montgomery R inverse operand: (1 << (DS_KEY_SIZE_BITS*2)) % M pub m_prime: u32, // - modinv(M mod 2^32, 2^32) mod 2^32 pub length: u32, // effective length: (DS_KEY_SIZE_BITS/32) - 1 } impl EspDsPData { /// Constructs EspDsPData from an RSA private key. /// /// Uses the following Python formulas: /// /// rr = 1 << (key_size * 2) /// rinv = rr % pub_numbers.n /// mprime = - modinv(M, 1 << 32) & 0xFFFFFFFF /// length = key_size // 32 - 1 /// /// In this implementation we assume DS_KEY_SIZE_BITS is the intended bit size. /// Y is taken as the private exponent and M as the modulus. pub fn new(rsa_private: &RsaPrivateKey) -> Result<Self, Box<dyn Error>> { // Get the private exponent (d) and modulus (n) as BigUint. let y_big = rsa_private.d(); let m_big = rsa_private.n(); // Convert Y and M into vectors of u32 words (little-endian). let y_vec = big_number_to_words(y_big); let m_vec = big_number_to_words(m_big); // Use the fixed DS_KEY_SIZE_BITS to compute the effective length. // For example, if DS_KEY_SIZE_BITS is 3072 then length = 3072/32 - 1 = 96 - 1 = 95. let length = (DS_KEY_SIZE_BITS / 32 - 1) as u32; // Convert the vectors into fixed-length arrays. let y_arr = vec_to_fixed(&y_vec, DS_NUM_WORDS); let m_arr = vec_to_fixed(&m_vec, DS_NUM_WORDS); // Compute m_prime = - modinv(M mod 2^32, 2^32) & 0xFFFFFFFF. let n0 = (m_big & BigUint::from(0xffffffffu32)) .to_u32() .ok_or("Failed to convert modulus remainder to u32")?; let inv_n0 = modinv_u32(n0).ok_or("Failed to compute modular inverse for m_prime")?; let m_prime = (!inv_n0).wrapping_add(1); // Compute Montgomery value as per Python: // rr = 1 << (DS_KEY_SIZE_BITS * 2) // rb = rr % M let rr = BigUint::one() << (DS_KEY_SIZE_BITS * 2); let rb_big = &rr % m_big; let rb_vec = big_number_to_words(&rb_big); let rb_arr = vec_to_fixed(&rb_vec, DS_NUM_WORDS); Ok(EspDsPData { y: y_arr, m: m_arr, rb: rb_arr, m_prime, length, }) } } /// Converts a BigUint into a Vec<u32> in little-endian order, /// stopping when the number becomes zero. fn big_number_to_words(num: &BigUint) -> Vec<u32> { let mut vec = Vec::new(); let mut n = num.clone(); let mask = BigUint::from(0xffffffffu32); while n > BigUint::zero() { let word = (&n & &mask).to_u32().unwrap(); vec.push(word); n >>= 32; } if vec.is_empty() { vec.push(0); } vec } /// Copies a vector of u32 into a fixed-length array, padding with zeros. fn vec_to_fixed(vec: &[u32], fixed_len: usize) -> [u32; DS_NUM_WORDS] { let mut arr = [0u32; DS_NUM_WORDS]; for (i, &word) in vec.iter().enumerate().take(fixed_len) { arr[i] = word; } arr } /// Computes the modular inverse of a modulo 2^32, assuming a is odd. fn modinv_u32(a: u32) -> Option<u32> { let modulus: i64 = 1i64 << 32; let mut r: i64 = modulus; let mut new_r: i64 = a as i64; let mut t: i64 = 0; let mut new_t: i64 = 1; while new_r != 0 { let quotient = r / new_r; let temp_t = t - quotient * new_t; t = new_t; new_t = temp_t; let temp_r = r - quotient * new_r; r = new_r; new_r = temp_r; } if r > 1 { return None; } if t < 0 { t += modulus; } Some(t as u32) } /// Custom Debug implementation that prints u32 arrays in "0x%08x" format. impl fmt::Debug for EspDsPData { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn format_array(arr: &[u32; DS_NUM_WORDS]) -> String { let formatted: Vec<String> = arr.iter().map(|word| format!("0x{word:08x}")).collect(); format!("{{ {} }}", formatted.join(", ")) } writeln!(f, "EspDsPData {{")?; writeln!(f, " y: {}", format_array(&self.y))?; writeln!(f, " m: {}", format_array(&self.m))?; writeln!(f, " rb: {}", format_array(&self.rb))?; writeln!(f, " m_prime: 0x{:08x}", self.m_prime)?; writeln!(f, " length: {}", self.length)?; write!(f, "}}") } } /// Encrypts the private key material following the ESP32-C3 DS scheme without extra padding. /// /// It constructs: /// /// md_in = number_as_bytes(Y, max_key_size) /// || number_as_bytes(M, max_key_size) /// || number_as_bytes(Rb, max_key_size) /// || pack::<LittleEndian>(m_prime, length) /// || iv /// /// md = SHA256(md_in) /// /// p = number_as_bytes(Y, max_key_size) /// || number_as_bytes(M, max_key_size) /// || number_as_bytes(Rb, max_key_size) /// || md /// || pack::<LittleEndian>(m_prime, length) /// || [0x08; 8] /// /// where max_key_size = DS_KEY_SIZE_BITS/8. Then p is encrypted using AES-256 in CBC mode with no padding. /// (Note: p must be block-aligned; for example, for a 3072-bit key, p ends up being 1200 bytes, which is /// a multiple of 16.) pub fn encrypt_private_key_material( ds_data: &EspDsPData, aes_key: &[u8], iv: &[u8], ) -> Result<Vec<u8>, Box<dyn Error>> { // For a fixed RSA key size (e.g., 3072 bits), max_key_size is: let max_key_size = DS_KEY_SIZE_BITS / 8; // e.g., 3072/8 = 384 bytes // Convert each of Y, M, and Rb into fixed-length little-endian byte arrays. let y_bytes = number_as_bytes(&ds_data.y, max_key_size); let m_bytes = number_as_bytes(&ds_data.m, max_key_size); let rb_bytes = number_as_bytes(&ds_data.rb, max_key_size); // Pack m_prime and length as little-endian u32 values. let mut mprime_length = Vec::new(); mprime_length.extend_from_slice(&ds_data.m_prime.to_le_bytes()); mprime_length.extend_from_slice(&ds_data.length.to_le_bytes()); // Construct md_in = Y || M || Rb || (m_prime||length) || IV. let mut md_in = Vec::new(); md_in.extend_from_slice(&y_bytes); md_in.extend_from_slice(&m_bytes); md_in.extend_from_slice(&rb_bytes); md_in.extend_from_slice(&mprime_length); md_in.extend_from_slice(iv); // Compute SHA256 digest of md_in. let md = Sha256::digest(&md_in); // 32 bytes // Construct p = Y || M || Rb || md || (m_prime||length) || 8 bytes of 0x08. let mut p = Vec::new(); p.extend_from_slice(&y_bytes); p.extend_from_slice(&m_bytes); p.extend_from_slice(&rb_bytes); p.extend_from_slice(&md); p.extend_from_slice(&mprime_length); p.extend_from_slice(&[0x08u8; 8]); // Verify that p is the expected length: // expected_len = (max_key_size * 3) + 32 + 8 + 8. let expected_len = (max_key_size * 3) + 32 + 8 + 8; assert_eq!( p.len(), expected_len, "P length mismatch: got {}, expected {}", p.len(), expected_len ); // Allocate an output buffer exactly the same size as p. let mut out_buf = vec![0u8; p.len()]; // Encrypt p using AES-256 in CBC mode with no padding. type Aes256CbcEnc = Encryptor<Aes256>; let ct = Aes256CbcEnc::new(aes_key.into(), iv.into()) .encrypt_padded_b2b_mut::<NoPadding>(&p, &mut out_buf) .map_err(|e| format!("Encryption error: {e:?}"))?; let iv_and_ct = [iv, ct].concat(); Ok(iv_and_ct) } /// Converts a fixed-length u32 array (representing a big number in little-endian order) /// into a byte vector of exactly `max_bytes` length. Each u32 is converted using `to_le_bytes()`, /// then the vector is truncated or padded with zeros to exactly max_bytes. fn number_as_bytes(arr: &[u32; DS_NUM_WORDS], max_bytes: usize) -> Vec<u8> { let mut bytes = Vec::with_capacity(DS_NUM_WORDS * 4); for &word in arr.iter() { bytes.extend_from_slice(&word.to_le_bytes()); } if bytes.len() > max_bytes { bytes.truncate(max_bytes); } else { while bytes.len() < max_bytes { bytes.push(0); } } bytes }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/main.rs
frostsnap_factory/src/main.rs
use std::{collections::HashSet, env}; use clap::Parser; use frostsnap_comms::{genuine_certificate::CaseColor, Sha256Digest}; use frostsnap_core::{ hex, schnorr_fun::fun::{marker::EvenY, KeyPair, Scalar}, }; pub mod cli; pub mod db; pub mod ds; pub mod process; const BOARD_REVISION: &str = "2.7-1625"; pub const USB_VID: u16 = 12346; pub const USB_PID: u16 = 4097; pub struct FactoryState { pub target_color: CaseColor, pub target_quantity: usize, pub operator: String, pub devices_flashed: HashSet<String>, // serial numbers pub genuine_checks: HashSet<String>, //serial numbers pub devices_failed: usize, pub revision: String, pub factory_keypair: KeyPair<EvenY>, pub db: db::Database, pub batch_note: Option<String>, } impl FactoryState { pub fn new( color: CaseColor, quantity: usize, operator: String, revision: String, factory_keypair: KeyPair<EvenY>, db_connection_url: String, batch_note: Option<String>, ) -> Result<Self, Box<dyn std::error::Error>> { let db = db::Database::new(db_connection_url)?; Ok(FactoryState { target_color: color, target_quantity: quantity, operator, devices_flashed: Default::default(), genuine_checks: Default::default(), devices_failed: 0, revision, factory_keypair, db, batch_note, }) } pub fn record_success( &mut self, serial_number: &str, ) -> Result<(), Box<dyn std::error::Error>> { self.db.mark_factory_complete( serial_number, &self.target_color.to_string(), &self.operator, &self.revision, self.batch_note.as_deref(), )?; self.devices_flashed.insert(serial_number.to_string()); Ok(()) } pub fn record_genuine_verified( &mut self, serial_number: &str, firmware_digest: Sha256Digest, ) -> Result<(), Box<dyn std::error::Error>> { self.db .mark_genuine_verified(serial_number, firmware_digest)?; self.genuine_checks.insert(serial_number.to_string()); Ok(()) } pub fn record_failure( &mut self, serial_number: &str, reason: &str, ) -> Result<(), Box<dyn std::error::Error>> { self.db.mark_failed( serial_number, &self.target_color.to_string(), &self.operator, &self.revision, reason, self.batch_note.as_deref(), )?; self.devices_failed += 1; Ok(()) } pub fn is_complete(&self) -> bool { self.devices_complete() >= self.target_quantity } pub fn devices_complete(&self) -> usize { self.genuine_checks .intersection(&self.devices_flashed) .count() } pub fn print_progress(&self) { let devices_complete = self.devices_complete(); let percentage = if self.target_quantity > 0 { (devices_complete as f32 / self.target_quantity as f32) * 100.0 } else { 0.0 }; println!( "Factory Tool - {} devices (Operator: {})", self.target_color, self.operator ); println!( "Progress: {}/{} ({:.1}%)", devices_complete, self.target_quantity, percentage ); println!( "Success: {} | Failed: {}", devices_complete, self.devices_failed ); } } fn load_factory_keypair( path: &std::path::Path, ) -> Result<KeyPair<EvenY>, Box<dyn std::error::Error>> { let hex_content = std::fs::read_to_string(path)?; let hex_content = hex_content.trim(); let hex_content = hex_content.strip_prefix("0x").unwrap_or(hex_content); let bytes = hex::decode(hex_content)?; if bytes.len() != 32 { return Err(format!("Expected 32 bytes, got {}", bytes.len()).into()); } let mut array = [0u8; 32]; array.copy_from_slice(&bytes); let factory_secret = Scalar::from_bytes_mod_order(array) .non_zero() .ok_or("Invalid secret key: resulted in zero scalar")?; let factory_keypair = KeyPair::new_xonly(factory_secret); if factory_keypair.public_key().to_xonly_bytes() != frostsnap_comms::FACTORY_PUBLIC_KEY { return Err("Loaded factory secret does not match expected public key".into()); } Ok(factory_keypair) } fn main() -> Result<(), Box<dyn std::error::Error>> { let args = cli::Args::parse(); match args.command { cli::Commands::Batch { color, quantity, operator, factory_secret, db_connection_url, batch_note, } => { let factory_keypair = load_factory_keypair(&factory_secret)?; let db_connection_url = db_connection_url .or_else(|| env::var("DATABASE_URL").ok()) .ok_or("No database URL provided via --db-connection-url or DATABASE_URL")?; let mut factory_state = FactoryState::new( color, quantity, operator.clone(), BOARD_REVISION.to_string(), factory_keypair, db_connection_url, batch_note, )?; println!("Starting factory batch:"); println!("Color: {color}, Quantity: {quantity}, Operator: {operator}"); process::run_with_state(&mut factory_state); } } }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_14_light.rs
frostsnap_fonts/src/noto_sans_14_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 14px //! Weight: 300 //! Characters: 95 //! Line height: 15px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_14_LIGHT_DATA: &[u8] = &[ 0xc5, 0xc5, 0xc4, 0xb4, 0xb3, 0xb3, 0xb2, 0x60, 0x41, 0xd6, 0x30, 0x1d, 0x0c, 0x40, 0xc0, 0xb2, 0x0b, 0x0b, 0x10, 0x80, 0x80, 0x00, 0x0a, 0x50, 0x96, 0x00, 0x00, 0xb1, 0x0b, 0x20, 0x00, 0x0c, 0x00, 0xb0, 0x03, 0xbc, 0xdb, 0xbd, 0xb9, 0x00, 0x79, 0x06, 0x90, 0x00, 0x09, 0x60, 0x87, 0x00, 0x9b, 0xdc, 0xbd, 0xcb, 0x40, 0x0c, 0x00, 0xc0, 0x00, 0x02, 0xb0, 0x1b, 0x00, 0x00, 0x69, 0x05, 0xa0, 0x00, 0x00, 0x07, 0x40, 0x00, 0x18, 0xcb, 0x94, 0x0c, 0x9a, 0x78, 0x63, 0xc0, 0x95, 0x00, 0x1d, 0x49, 0x50, 0x00, 0x6c, 0xd7, 0x00, 0x00, 0x0a, 0xcc, 0x50, 0x00, 0x95, 0x5c, 0x00, 0x09, 0x51, 0xd3, 0x96, 0xa8, 0xb9, 0x17, 0xac, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xc4, 0x00, 0x5a, 0x00, 0x3b, 0x05, 0xa0, 0x0b, 0x30, 0x06, 0xa0, 0x0c, 0x07, 0x90, 0x00, 0x6a, 0x00, 0xc1, 0xc1, 0x30, 0x03, 0xb0, 0x5a, 0x98, 0xba, 0xc2, 0x0a, 0xbc, 0x5c, 0x5a, 0x07, 0x90, 0x03, 0x1a, 0x68, 0x80, 0x4a, 0x00, 0x04, 0xb0, 0x88, 0x04, 0xa0, 0x00, 0xb4, 0x05, 0xa0, 0x79, 0x00, 0x5a, 0x00, 0x0b, 0xac, 0x20, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x40, 0x00, 0x00, 0x00, 0x9c, 0xbc, 0x30, 0x00, 0x04, 0xc0, 0x08, 0xa0, 0x00, 0x03, 0xc0, 0x08, 0x90, 0x00, 0x00, 0xb7, 0x7c, 0x20, 0x00, 0x00, 0x5e, 0xc2, 0x00, 0x00, 0x07, 0xc5, 0xc7, 0x00, 0x95, 0x2d, 0x20, 0x2c, 0x72, 0xd0, 0x5c, 0x00, 0x02, 0xcc, 0x80, 0x2d, 0x30, 0x01, 0xad, 0x70, 0x07, 0xdb, 0xbc, 0x82, 0xc7, 0x00, 0x04, 0x30, 0x00, 0x00, 0x1d, 0x0c, 0x0b, 0x08, 0x00, 0xb5, 0x08, 0xa0, 0x0c, 0x30, 0x3c, 0x00, 0x7a, 0x00, 0x89, 0x00, 0x89, 0x00, 0x7a, 0x00, 0x5c, 0x00, 0x0d, 0x20, 0x09, 0x80, 0x01, 0xc3, 0x00, 0x43, 0x6b, 0x00, 0x0b, 0x60, 0x05, 0xb0, 0x00, 0xd1, 0x00, 0xc5, 0x00, 0xa6, 0x00, 0xa7, 0x00, 0xb5, 0x00, 0xd2, 0x04, 0xc0, 0x0a, 0x80, 0x4c, 0x00, 0x43, 0x00, 0x00, 0x08, 0x50, 0x00, 0x00, 0xa5, 0x00, 0x4a, 0x5a, 0x57, 0xa2, 0x79, 0xdc, 0x96, 0x00, 0x7a, 0xc3, 0x00, 0x3d, 0x27, 0xc0, 0x00, 0x40, 0x04, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x08, 0x80, 0x00, 0x37, 0x7a, 0xa7, 0x73, 0x48, 0x8b, 0xb8, 0x84, 0x00, 0x08, 0x80, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x04, 0x40, 0x00, 0x09, 0x40, 0xd1, 0x4b, 0x07, 0x60, 0x35, 0x54, 0x6b, 0xba, 0x41, 0xd6, 0x30, 0x00, 0x07, 0xa0, 0x00, 0xb5, 0x00, 0x3c, 0x00, 0x09, 0x80, 0x00, 0xc2, 0x00, 0x5b, 0x00, 0x0a, 0x70, 0x01, 0xd1, 0x00, 0x7a, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x03, 0x30, 0x00, 0x02, 0xcb, 0xbc, 0x20, 0x0b, 0x70, 0x07, 0xa0, 0x0d, 0x00, 0x00, 0xd0, 0x4b, 0x00, 0x00, 0xc4, 0x5b, 0x00, 0x00, 0xb5, 0x5b, 0x00, 0x00, 0xb5, 0x4c, 0x00, 0x00, 0xc4, 0x0d, 0x00, 0x00, 0xd0, 0x0a, 0x70, 0x07, 0xa0, 0x02, 0xcb, 0xbc, 0x20, 0x00, 0x03, 0x30, 0x00, 0x02, 0xbc, 0x4c, 0x8c, 0x74, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x04, 0x20, 0x00, 0x09, 0xcb, 0xcb, 0x10, 0x07, 0x10, 0x09, 0x90, 0x00, 0x00, 0x06, 0xb0, 0x00, 0x00, 0x08, 0xa0, 0x00, 0x00, 0x1c, 0x30, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x0a, 0x90, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x6e, 0xcc, 0xcc, 0xc2, 0x00, 0x14, 0x20, 0x00, 0x2a, 0xcb, 0xcc, 0x30, 0x26, 0x00, 0x08, 0xa0, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x09, 0x80, 0x00, 0x9b, 0xc9, 0x00, 0x00, 0x56, 0x8c, 0x80, 0x00, 0x00, 0x02, 0xd0, 0x00, 0x00, 0x00, 0xd1, 0x20, 0x00, 0x06, 0xc0, 0x6c, 0xbb, 0xcc, 0x40, 0x00, 0x24, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5e, 0x40, 0x00, 0x01, 0xcc, 0x40, 0x00, 0x0a, 0x7b, 0x40, 0x00, 0x7a, 0x0b, 0x40, 0x03, 0xc1, 0x0b, 0x40, 0x0b, 0x50, 0x0b, 0x40, 0x9b, 0x66, 0x6c, 0x75, 0x8a, 0xaa, 0xad, 0xb9, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x0b, 0x40, 0x09, 0xdc, 0xcc, 0x80, 0x0a, 0x70, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x0b, 0x31, 0x00, 0x00, 0x0b, 0xcb, 0xcc, 0x40, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc3, 0x12, 0x00, 0x06, 0xc0, 0x2c, 0xcb, 0xcb, 0x30, 0x00, 0x24, 0x20, 0x00, 0x00, 0x00, 0x34, 0x10, 0x00, 0x5c, 0xba, 0x80, 0x04, 0xc3, 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0x0c, 0x03, 0x52, 0x00, 0x2c, 0xaa, 0xac, 0x70, 0x4e, 0x50, 0x01, 0xd2, 0x2c, 0x00, 0x00, 0xb6, 0x0c, 0x00, 0x00, 0xb5, 0x09, 0x80, 0x03, 0xd1, 0x01, 0xbb, 0xbc, 0x60, 0x00, 0x03, 0x40, 0x00, 0x6c, 0xcc, 0xcc, 0xe6, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x1d, 0x20, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x06, 0xb0, 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x05, 0xcb, 0xbc, 0x50, 0x0c, 0x40, 0x05, 0xc0, 0x0d, 0x00, 0x02, 0xd0, 0x09, 0xa1, 0x1b, 0x80, 0x00, 0x8d, 0xd7, 0x00, 0x06, 0xc6, 0x8c, 0x60, 0x2d, 0x20, 0x03, 0xd2, 0x5b, 0x00, 0x00, 0xb4, 0x2d, 0x20, 0x03, 0xd1, 0x07, 0xcb, 0xbc, 0x60, 0x00, 0x04, 0x30, 0x00, 0x00, 0x04, 0x20, 0x00, 0x05, 0xcb, 0xcb, 0x10, 0x1d, 0x30, 0x09, 0x90, 0x5b, 0x00, 0x00, 0xc0, 0x6b, 0x00, 0x00, 0xc2, 0x2d, 0x10, 0x05, 0xe4, 0x08, 0xca, 0xaa, 0xc2, 0x00, 0x25, 0x30, 0xc0, 0x00, 0x00, 0x05, 0xb0, 0x00, 0x00, 0x3c, 0x40, 0x09, 0xab, 0xc6, 0x00, 0x02, 0x43, 0x00, 0x00, 0x94, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x41, 0xd6, 0x30, 0x09, 0x30, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x31, 0xd0, 0x5b, 0x08, 0x60, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x3a, 0xb4, 0x00, 0x3a, 0xb6, 0x00, 0x3a, 0xa5, 0x00, 0x00, 0x3b, 0xb5, 0x00, 0x00, 0x00, 0x4a, 0xb7, 0x00, 0x00, 0x00, 0x29, 0xc4, 0x00, 0x00, 0x00, 0x12, 0x5b, 0xbb, 0xbb, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0xcc, 0xcc, 0xc4, 0x32, 0x00, 0x00, 0x00, 0x4c, 0xa3, 0x00, 0x00, 0x00, 0x6b, 0xa3, 0x00, 0x00, 0x00, 0x5b, 0xa3, 0x00, 0x00, 0x5b, 0xb3, 0x00, 0x7b, 0xa3, 0x00, 0x5c, 0x92, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x42, 0x00, 0x8c, 0xbc, 0xb1, 0x10, 0x00, 0xa7, 0x00, 0x00, 0x89, 0x00, 0x00, 0xc5, 0x00, 0x1b, 0x80, 0x00, 0xb7, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x40, 0x00, 0x05, 0xe0, 0x00, 0x00, 0x30, 0x00, 0x00, 0x05, 0xbb, 0xbb, 0xb5, 0x00, 0x00, 0x9b, 0x40, 0x00, 0x3b, 0x80, 0x07, 0xb0, 0x02, 0x54, 0x00, 0xc4, 0x0c, 0x20, 0x8c, 0x9b, 0xa0, 0x79, 0x3b, 0x04, 0xc1, 0x06, 0x90, 0x3b, 0x6a, 0x08, 0x90, 0x07, 0x90, 0x3b, 0x5a, 0x07, 0x90, 0x09, 0x90, 0x69, 0x3b, 0x03, 0xc6, 0x7a, 0xb5, 0xb3, 0x0c, 0x30, 0x49, 0x81, 0x69, 0x40, 0x05, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xa8, 0x8a, 0xa0, 0x00, 0x00, 0x00, 0x57, 0x75, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x0b, 0xb7, 0x00, 0x00, 0x03, 0xc5, 0xb0, 0x00, 0x00, 0x98, 0x0c, 0x20, 0x00, 0x0d, 0x20, 0x99, 0x00, 0x06, 0xc5, 0x56, 0xd0, 0x00, 0xbb, 0xaa, 0xad, 0x50, 0x3c, 0x00, 0x00, 0x7a, 0x09, 0x90, 0x00, 0x01, 0xd1, 0xc3, 0x00, 0x00, 0x0a, 0x70, 0xbd, 0xcc, 0xca, 0x20, 0xb6, 0x00, 0x09, 0xa0, 0xb6, 0x00, 0x04, 0xc0, 0xb6, 0x00, 0x08, 0xa0, 0xbc, 0xbb, 0xca, 0x10, 0xb7, 0x44, 0x6b, 0x80, 0xb6, 0x00, 0x01, 0xd1, 0xb6, 0x00, 0x00, 0xd2, 0xb6, 0x00, 0x08, 0xc0, 0xbc, 0xcc, 0xcb, 0x30, 0x00, 0x00, 0x24, 0x20, 0x00, 0x04, 0xbc, 0xbc, 0xd4, 0x04, 0xd6, 0x00, 0x01, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x1d, 0x10, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x0c, 0x70, 0x00, 0x00, 0x00, 0x5d, 0x50, 0x00, 0x00, 0x00, 0x5c, 0xcb, 0xcc, 0x00, 0x00, 0x02, 0x42, 0x00, 0xbd, 0xcc, 0xca, 0x30, 0x0b, 0x60, 0x00, 0x7d, 0x30, 0xb6, 0x00, 0x00, 0x8b, 0x0b, 0x60, 0x00, 0x01, 0xd0, 0xb6, 0x00, 0x00, 0x0d, 0x2b, 0x60, 0x00, 0x00, 0xd1, 0xb6, 0x00, 0x00, 0x1d, 0x0b, 0x60, 0x00, 0x08, 0xa0, 0xb6, 0x00, 0x18, 0xd2, 0x0b, 0xdc, 0xcc, 0xa2, 0x00, 0xbd, 0xcc, 0xcb, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xbc, 0xbb, 0xb8, 0xb7, 0x44, 0x43, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xbd, 0xcc, 0xcb, 0xbd, 0xcc, 0xcb, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb8, 0x55, 0x54, 0xbc, 0xbb, 0xb8, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x14, 0x41, 0x00, 0x00, 0x3b, 0xcb, 0xbc, 0xb0, 0x02, 0xd7, 0x00, 0x00, 0x20, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x0d, 0x10, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x02, 0x44, 0x40, 0x3c, 0x00, 0x08, 0xbb, 0xe2, 0x0d, 0x00, 0x00, 0x00, 0xc2, 0x0b, 0x70, 0x00, 0x00, 0xc2, 0x04, 0xd5, 0x00, 0x00, 0xc2, 0x00, 0x5c, 0xcb, 0xbc, 0xc1, 0x00, 0x00, 0x14, 0x31, 0x00, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0xbc, 0xbb, 0xbb, 0xbc, 0xb7, 0x44, 0x44, 0x6c, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0xb6, 0x00, 0x00, 0x4c, 0x5c, 0xd8, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x06, 0xb0, 0x5c, 0xd8, 0x00, 0x0b, 0x60, 0x00, 0xb6, 0x00, 0x0b, 0x60, 0x00, 0xb6, 0x00, 0x0b, 0x60, 0x00, 0xb6, 0x00, 0x0b, 0x60, 0x00, 0xb6, 0x00, 0x0b, 0x60, 0x00, 0xb6, 0x00, 0x0c, 0x43, 0x68, 0xd0, 0x4a, 0x93, 0x00, 0xb6, 0x00, 0x08, 0xb1, 0xb6, 0x00, 0x7b, 0x10, 0xb6, 0x07, 0xc1, 0x00, 0xb6, 0x6c, 0x20, 0x00, 0xb9, 0xe7, 0x00, 0x00, 0xbc, 0x5d, 0x30, 0x00, 0xb6, 0x07, 0xc0, 0x00, 0xb6, 0x00, 0xb9, 0x00, 0xb6, 0x00, 0x2d, 0x50, 0xb6, 0x00, 0x05, 0xd2, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xbd, 0xcc, 0xcb, 0xbd, 0x00, 0x00, 0x00, 0xbd, 0xbc, 0x60, 0x00, 0x02, 0xcc, 0xb8, 0xb0, 0x00, 0x08, 0x8d, 0xb5, 0xc2, 0x00, 0x0c, 0x2d, 0xb5, 0x98, 0x00, 0x5b, 0x0d, 0xb5, 0x3c, 0x00, 0xb5, 0x0d, 0xb5, 0x0b, 0x52, 0xc0, 0x0d, 0xb5, 0x06, 0xa8, 0x80, 0x0d, 0xb5, 0x00, 0xdc, 0x20, 0x0d, 0xb5, 0x00, 0x9b, 0x00, 0x0d, 0xbb, 0x00, 0x00, 0x0c, 0xbd, 0x70, 0x00, 0x0c, 0xb6, 0xd2, 0x00, 0x0c, 0xb5, 0x8b, 0x00, 0x0c, 0xb5, 0x0c, 0x60, 0x0c, 0xb5, 0x04, 0xd2, 0x0c, 0xb5, 0x00, 0x8b, 0x0c, 0xb5, 0x00, 0x0c, 0x6c, 0xb5, 0x00, 0x04, 0xdc, 0xb5, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x24, 0x20, 0x00, 0x00, 0x5c, 0xcb, 0xcb, 0x30, 0x05, 0xd4, 0x00, 0x06, 0xd2, 0x0c, 0x60, 0x00, 0x00, 0xa9, 0x1d, 0x00, 0x00, 0x00, 0x5c, 0x3c, 0x00, 0x00, 0x00, 0x2d, 0x4c, 0x00, 0x00, 0x00, 0x1d, 0x1d, 0x00, 0x00, 0x00, 0x5c, 0x0c, 0x60, 0x00, 0x00, 0xa9, 0x05, 0xd4, 0x00, 0x06, 0xd2, 0x00, 0x6c, 0xcb, 0xcb, 0x30, 0x00, 0x00, 0x24, 0x20, 0x00, 0xbd, 0xcc, 0xc7, 0x0b, 0x60, 0x03, 0xd5, 0xb6, 0x00, 0x09, 0x9b, 0x60, 0x00, 0x98, 0xb6, 0x00, 0x5d, 0x3b, 0xdc, 0xcb, 0x50, 0xb6, 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x00, 0x24, 0x20, 0x00, 0x00, 0x5c, 0xcb, 0xcb, 0x30, 0x05, 0xd4, 0x00, 0x06, 0xd2, 0x0c, 0x60, 0x00, 0x00, 0xa9, 0x1d, 0x00, 0x00, 0x00, 0x5c, 0x3c, 0x00, 0x00, 0x00, 0x2d, 0x4c, 0x00, 0x00, 0x00, 0x1d, 0x1d, 0x00, 0x00, 0x00, 0x5c, 0x0c, 0x60, 0x00, 0x00, 0xa9, 0x05, 0xd4, 0x00, 0x06, 0xd2, 0x00, 0x6c, 0xcb, 0xcb, 0x30, 0x00, 0x00, 0x25, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x50, 0x00, 0x00, 0x00, 0x05, 0x70, 0xbd, 0xcc, 0xc8, 0x00, 0xb6, 0x00, 0x2c, 0x60, 0xb6, 0x00, 0x08, 0x90, 0xb6, 0x00, 0x0a, 0x80, 0xb6, 0x13, 0x8c, 0x20, 0xbc, 0xcd, 0xb2, 0x00, 0xb6, 0x02, 0xd3, 0x00, 0xb6, 0x00, 0x8b, 0x00, 0xb6, 0x00, 0x0c, 0x60, 0xb6, 0x00, 0x05, 0xd1, 0x00, 0x03, 0x41, 0x00, 0x6c, 0xcb, 0xc9, 0x1d, 0x40, 0x00, 0x13, 0xc0, 0x00, 0x00, 0x0d, 0x50, 0x00, 0x00, 0x5c, 0xb6, 0x00, 0x00, 0x06, 0xbc, 0x40, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x7c, 0x5d, 0xcb, 0xcc, 0x30, 0x03, 0x42, 0x00, 0xcc, 0xce, 0xcc, 0xc6, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x0c, 0x40, 0x00, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x1d, 0xa7, 0x00, 0x00, 0x5c, 0x5c, 0x20, 0x01, 0xb7, 0x07, 0xcb, 0xbc, 0x80, 0x00, 0x03, 0x40, 0x00, 0xd3, 0x00, 0x00, 0x1d, 0x19, 0x90, 0x00, 0x07, 0xb0, 0x4c, 0x00, 0x00, 0xb6, 0x00, 0xc5, 0x00, 0x2d, 0x00, 0x08, 0xa0, 0x08, 0xa0, 0x00, 0x2d, 0x00, 0xc4, 0x00, 0x00, 0xb6, 0x4c, 0x00, 0x00, 0x06, 0xb9, 0x80, 0x00, 0x00, 0x0d, 0xc2, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0xa7, 0x00, 0x07, 0xd0, 0x00, 0x0c, 0x57, 0xa0, 0x00, 0xbd, 0x40, 0x01, 0xd0, 0x2d, 0x00, 0x0c, 0x88, 0x00, 0x6b, 0x00, 0xc3, 0x05, 0xb3, 0xc0, 0x0a, 0x80, 0x0a, 0x80, 0x98, 0x0c, 0x10, 0xc3, 0x00, 0x6b, 0x0c, 0x30, 0xa7, 0x2d, 0x00, 0x01, 0xd2, 0xc0, 0x06, 0xa7, 0xa0, 0x00, 0x0c, 0x8a, 0x00, 0x1c, 0xa7, 0x00, 0x00, 0x9d, 0x60, 0x00, 0xbd, 0x10, 0x00, 0x04, 0xe1, 0x00, 0x08, 0xc0, 0x00, 0x9a, 0x00, 0x01, 0xc4, 0x0c, 0x50, 0x09, 0x90, 0x05, 0xc0, 0x4c, 0x10, 0x00, 0xa8, 0xb5, 0x00, 0x00, 0x1d, 0xa0, 0x00, 0x00, 0x4c, 0xc0, 0x00, 0x00, 0xc5, 0x99, 0x00, 0x08, 0x90, 0x1c, 0x40, 0x4c, 0x10, 0x06, 0xc0, 0xc6, 0x00, 0x00, 0xb8, 0xc5, 0x00, 0x00, 0xb6, 0x5c, 0x00, 0x06, 0xc0, 0x0b, 0x60, 0x0c, 0x50, 0x04, 0xc0, 0x7b, 0x00, 0x00, 0xa7, 0xc4, 0x00, 0x00, 0x3d, 0xa0, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x5c, 0xcc, 0xcc, 0xe7, 0x00, 0x00, 0x06, 0xc0, 0x00, 0x00, 0x2d, 0x40, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x06, 0xc0, 0x00, 0x00, 0x2d, 0x40, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x06, 0xc0, 0x00, 0x00, 0x2d, 0x40, 0x00, 0x00, 0x9e, 0xcc, 0xcc, 0xc8, 0xdc, 0xc4, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd9, 0x93, 0x56, 0x62, 0xb5, 0x00, 0x07, 0xa0, 0x00, 0x1d, 0x00, 0x00, 0xa7, 0x00, 0x05, 0xb0, 0x00, 0x0c, 0x20, 0x00, 0x98, 0x00, 0x03, 0xc0, 0x00, 0x0b, 0x50, 0x00, 0x7a, 0x9c, 0xd7, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x00, 0x97, 0x79, 0xc7, 0x56, 0x63, 0x00, 0x01, 0x10, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x4b, 0xb3, 0x00, 0x00, 0xa5, 0x5a, 0x00, 0x04, 0xb0, 0x0b, 0x30, 0x0a, 0x50, 0x05, 0xa0, 0x4b, 0x00, 0x00, 0xb4, 0x33, 0x00, 0x00, 0x33, 0x1b, 0xbb, 0xbb, 0xa0, 0x5a, 0x00, 0x0a, 0x80, 0x00, 0x82, 0x02, 0x8a, 0xa4, 0x00, 0x78, 0x56, 0xd3, 0x00, 0x00, 0x0a, 0x70, 0x02, 0x67, 0xb8, 0x0a, 0xb9, 0x7b, 0x86, 0xb0, 0x00, 0xa8, 0x7b, 0x00, 0x2d, 0x81, 0xbb, 0xbb, 0x88, 0x00, 0x23, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x0d, 0x10, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x0d, 0x28, 0xa9, 0x20, 0xcb, 0x74, 0x8c, 0x1d, 0x70, 0x00, 0xa7, 0xd3, 0x00, 0x07, 0xad, 0x20, 0x00, 0x7a, 0xd5, 0x00, 0x09, 0x9c, 0xa0, 0x02, 0xd4, 0xb8, 0xcb, 0xd8, 0x00, 0x02, 0x41, 0x00, 0x00, 0x49, 0xa9, 0x20, 0x7c, 0x75, 0x72, 0x0d, 0x30, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x0c, 0x60, 0x00, 0x00, 0x3c, 0xbb, 0xc3, 0x00, 0x02, 0x41, 0x00, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x6a, 0xa5, 0xb5, 0x08, 0xc6, 0x5b, 0xc5, 0x0d, 0x20, 0x01, 0xe5, 0x4c, 0x00, 0x00, 0xc5, 0x5b, 0x00, 0x00, 0xb5, 0x3c, 0x00, 0x00, 0xc5, 0x0c, 0x50, 0x05, 0xe5, 0x05, 0xcb, 0xbb, 0xa5, 0x00, 0x03, 0x20, 0x00, 0x00, 0x5a, 0xa6, 0x00, 0x7c, 0x65, 0xc7, 0x0d, 0x20, 0x04, 0xc4, 0xd7, 0x77, 0x7d, 0x5d, 0x88, 0x88, 0x83, 0xd0, 0x00, 0x00, 0x0c, 0x70, 0x00, 0x00, 0x3c, 0xcb, 0xc9, 0x00, 0x02, 0x42, 0x00, 0x00, 0x8b, 0xb1, 0x06, 0xc2, 0x30, 0x09, 0x80, 0x00, 0x6c, 0xb9, 0x20, 0x5a, 0xa6, 0x10, 0x09, 0x80, 0x00, 0x09, 0x80, 0x00, 0x09, 0x80, 0x00, 0x09, 0x80, 0x00, 0x09, 0x80, 0x00, 0x09, 0x80, 0x00, 0x00, 0x6a, 0xa5, 0x63, 0x08, 0xc6, 0x5a, 0xc5, 0x0d, 0x20, 0x01, 0xd5, 0x4c, 0x00, 0x00, 0xc5, 0x5b, 0x00, 0x00, 0xb5, 0x2c, 0x00, 0x00, 0xc5, 0x0c, 0x60, 0x05, 0xe5, 0x04, 0xcb, 0xbb, 0xb5, 0x00, 0x03, 0x30, 0xc4, 0x00, 0x00, 0x02, 0xd1, 0x0a, 0xa8, 0x9c, 0x80, 0x01, 0x67, 0x74, 0x00, 0xa1, 0x00, 0x00, 0x0d, 0x10, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x0d, 0x28, 0xa9, 0x20, 0xcb, 0x75, 0x8c, 0x0d, 0x70, 0x00, 0xc4, 0xd2, 0x00, 0x0b, 0x5d, 0x10, 0x00, 0xb5, 0xd1, 0x00, 0x0b, 0x5d, 0x10, 0x00, 0xb5, 0xd1, 0x00, 0x0b, 0x50, 0x40, 0xd3, 0x00, 0x80, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0x00, 0x40, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x80, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0xd0, 0x79, 0xc0, 0x67, 0x20, 0xa1, 0x00, 0x00, 0xd1, 0x00, 0x00, 0xd1, 0x00, 0x00, 0xd1, 0x00, 0x66, 0xd1, 0x06, 0xc1, 0xd1, 0x5c, 0x20, 0xd4, 0xd3, 0x00, 0xdb, 0xc7, 0x00, 0xd4, 0x3d, 0x40, 0xd1, 0x06, 0xc1, 0xd1, 0x00, 0x9a, 0xa1, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0x72, 0x9a, 0x70, 0x5a, 0xa5, 0x0c, 0xb6, 0x5c, 0xab, 0x57, 0xd3, 0xd6, 0x00, 0x6d, 0x10, 0x0a, 0x7d, 0x20, 0x04, 0xc0, 0x00, 0x98, 0xd1, 0x00, 0x4c, 0x00, 0x09, 0x8d, 0x10, 0x04, 0xc0, 0x00, 0x98, 0xd1, 0x00, 0x4c, 0x00, 0x09, 0x8d, 0x10, 0x04, 0xc0, 0x00, 0x98, 0x71, 0x8a, 0x92, 0x0c, 0xb7, 0x58, 0xc0, 0xd7, 0x00, 0x0c, 0x4d, 0x30, 0x00, 0xb5, 0xd1, 0x00, 0x0b, 0x5d, 0x10, 0x00, 0xb5, 0xd1, 0x00, 0x0b, 0x5d, 0x10, 0x00, 0xb5, 0x00, 0x5a, 0xa7, 0x00, 0x07, 0xc6, 0x5a, 0xb0, 0x0d, 0x20, 0x00, 0xc5, 0x4c, 0x00, 0x00, 0x98, 0x5b, 0x00, 0x00, 0x89, 0x2d, 0x00, 0x00, 0xa7, 0x0b, 0x60, 0x03, 0xc2, 0x03, 0xbb, 0xbc, 0x50, 0x00, 0x03, 0x40, 0x00, 0x71, 0x8a, 0x92, 0x0c, 0xa7, 0x59, 0xc1, 0xc8, 0x00, 0x0a, 0x8c, 0x30, 0x00, 0x7a, 0xc2, 0x00, 0x06, 0xbc, 0x50, 0x00, 0x89, 0xca, 0x00, 0x2d, 0x5c, 0x8b, 0xbc, 0x80, 0xc2, 0x14, 0x10, 0x0c, 0x20, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x06, 0x10, 0x00, 0x00, 0x00, 0x6a, 0xa5, 0x63, 0x08, 0xc6, 0x5b, 0xc5, 0x1d, 0x20, 0x02, 0xe5, 0x5c, 0x00, 0x00, 0xc5, 0x5b, 0x00, 0x00, 0xb5, 0x3c, 0x00, 0x00, 0xc5, 0x0c, 0x50, 0x05, 0xe5, 0x05, 0xcb, 0xba, 0xb5, 0x00, 0x03, 0x20, 0xb5, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x52, 0x71, 0x8a, 0x4c, 0xb8, 0x52, 0xc8, 0x00, 0x0c, 0x30, 0x00, 0xc2, 0x00, 0x0c, 0x20, 0x00, 0xc2, 0x00, 0x0c, 0x20, 0x00, 0x04, 0x9a, 0x95, 0x3c, 0x64, 0x67, 0x6b, 0x00, 0x00, 0x1c, 0xb5, 0x00, 0x00, 0x6b, 0xc5, 0x00, 0x00, 0x5d, 0x10, 0x00, 0x2d, 0x7c, 0xbb, 0xc7, 0x00, 0x34, 0x00, 0x04, 0x10, 0x00, 0xa3, 0x00, 0x7d, 0xa9, 0x55, 0xd7, 0x63, 0x0c, 0x30, 0x00, 0xc3, 0x00, 0x0c, 0x30, 0x00, 0xc3, 0x00, 0x0b, 0x50, 0x00, 0x6d, 0xb7, 0x00, 0x14, 0x00, 0x80, 0x00, 0x07, 0x2d, 0x00, 0x00, 0xc4, 0xd0, 0x00, 0x0c, 0x4d, 0x00, 0x00, 0xc4, 0xd0, 0x00, 0x0c, 0x4d, 0x00, 0x00, 0xd4, 0xc5, 0x00, 0x6e, 0x46, 0xdb, 0xba, 0xb4, 0x01, 0x42, 0x00, 0x00, 0x80, 0x00, 0x05, 0x6b, 0x60, 0x00, 0xb6, 0x7a, 0x00, 0x2c, 0x00, 0xd1, 0x08, 0x90, 0x0a, 0x70, 0xc3, 0x00, 0x4c, 0x4b, 0x00, 0x00, 0xca, 0x70, 0x00, 0x08, 0xd1, 0x00, 0x82, 0x00, 0x47, 0x00, 0x08, 0x1a, 0x70, 0x0a, 0xd1, 0x01, 0xd0, 0x7a, 0x00, 0xca, 0x60, 0x6b, 0x01, 0xd0, 0x5b, 0x6a, 0x0a, 0x70, 0x0c, 0x4a, 0x70, 0xc0, 0xc2, 0x00, 0x98, 0xc1, 0x0b, 0x6c, 0x00, 0x04, 0xcb, 0x00, 0x7c, 0xa0, 0x00, 0x0d, 0x70, 0x01, 0xe6, 0x00, 0x56, 0x00, 0x06, 0x52, 0xd4, 0x03, 0xc2, 0x06, 0xc0, 0xc6, 0x00, 0x09, 0xc9, 0x00, 0x00, 0x6e, 0x60, 0x00, 0x2c, 0x5c, 0x20, 0x0b, 0x70, 0x7b, 0x08, 0xa0, 0x00, 0xa8, 0x80, 0x00, 0x05, 0x6b, 0x60, 0x00, 0xb6, 0x6b, 0x00, 0x2d, 0x00, 0xd2, 0x08, 0x90, 0x09, 0x80, 0xc3, 0x00, 0x3c, 0x4c, 0x00, 0x00, 0xba, 0x70, 0x00, 0x07, 0xe1, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x8a, 0xa0, 0x00, 0x07, 0x60, 0x00, 0x00, 0x29, 0x99, 0x98, 0x16, 0x66, 0xab, 0x00, 0x03, 0xc2, 0x00, 0x0b, 0x60, 0x00, 0x8a, 0x00, 0x04, 0xc1, 0x00, 0x1c, 0x50, 0x00, 0x8d, 0xbb, 0xbb, 0x00, 0x6c, 0x80, 0x0d, 0x30, 0x00, 0xd0, 0x00, 0x0d, 0x00, 0x02, 0xc0, 0x05, 0xb9, 0x00, 0x7c, 0x70, 0x00, 0x3c, 0x00, 0x00, 0xd0, 0x00, 0x0d, 0x00, 0x00, 0xd0, 0x00, 0x09, 0xc7, 0x00, 0x02, 0x30, 0x83, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0x62, 0x8c, 0x70, 0x00, 0x2d, 0x00, 0x00, 0xd1, 0x00, 0x0d, 0x10, 0x00, 0xc3, 0x00, 0x09, 0xb5, 0x00, 0x7c, 0x70, 0x0c, 0x40, 0x00, 0xd1, 0x00, 0x0d, 0x10, 0x00, 0xd0, 0x07, 0xc9, 0x00, 0x32, 0x00, 0x00, 0x19, 0xba, 0x40, 0x54, 0x56, 0x16, 0xbc, 0xa2, ]; /// Glyph metadata for binary search pub const NOTO_SANS_14_LIGHT_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 4, data_offset: 0, }, GlyphInfo { character: '!', width: 2, height: 11, x_offset: 1, y_offset: 1, x_advance: 3, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 4, x_offset: 0, y_offset: 1, x_advance: 5, data_offset: 11, }, GlyphInfo { character: '#', width: 9, height: 10, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 21, }, GlyphInfo { character: '$', width: 7, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 66, }, GlyphInfo { character: '%', width: 11, height: 12, x_offset: 0, y_offset: 0, x_advance: 11, data_offset: 108, }, GlyphInfo { character: '&', width: 10, height: 12, x_offset: 0, y_offset: 0, x_advance: 10, data_offset: 174, }, GlyphInfo { character: '\'', width: 2, height: 4, x_offset: 0, y_offset: 1, x_advance: 3, data_offset: 234, }, GlyphInfo { character: '(', width: 4, height: 13, x_offset: 0, y_offset: 1, x_advance: 4, data_offset: 238, }, GlyphInfo { character: ')', width: 4, height: 13, x_offset: 0, y_offset: 1, x_advance: 4, data_offset: 264, }, GlyphInfo { character: '*', width: 7, height: 7, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 290, }, GlyphInfo { character: '+', width: 8, height: 8, x_offset: 0, y_offset: 2, x_advance: 8, data_offset: 315, }, GlyphInfo { character: ',', width: 3, height: 4, x_offset: 0, y_offset: 9, x_advance: 3, data_offset: 347, }, GlyphInfo { character: '-', width: 4, height: 2, x_offset: 0, y_offset: 6, x_advance: 5, data_offset: 353, }, GlyphInfo { character: '.', width: 2, height: 3, x_offset: 1, y_offset: 9, x_advance: 3, data_offset: 357, }, GlyphInfo { character: '/', width: 5, height: 10, x_offset: 0, y_offset: 1, x_advance: 5, data_offset: 360, }, GlyphInfo { character: '0', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 385, }, GlyphInfo { character: '1', width: 4, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 433, }, GlyphInfo { character: '2', width: 8, height: 11, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 453, }, GlyphInfo { character: '3', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 497, }, GlyphInfo { character: '4', width: 8, height: 11, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 545, }, GlyphInfo { character: '5', width: 8, height: 11, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 589, }, GlyphInfo { character: '6', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 633, }, GlyphInfo { character: '7', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 681, }, GlyphInfo { character: '8', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 721, }, GlyphInfo { character: '9', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 769, }, GlyphInfo { character: ':', width: 2, height: 9, x_offset: 1, y_offset: 3, x_advance: 3, data_offset: 817, }, GlyphInfo { character: ';', width: 3, height: 10, x_offset: 0, y_offset: 3, x_advance: 3, data_offset: 826, }, GlyphInfo { character: '<', width: 8, height: 8, x_offset: 0, y_offset: 2, x_advance: 8, data_offset: 841, }, GlyphInfo { character: '=', width: 8, height: 4, x_offset: 0, y_offset: 4, x_advance: 8, data_offset: 873, }, GlyphInfo { character: '>', width: 8, height: 8, x_offset: 0, y_offset: 2, x_advance: 8, data_offset: 889, }, GlyphInfo { character: '?', width: 6, height: 12, x_offset: 0, y_offset: 0, x_advance: 6, data_offset: 921, }, GlyphInfo { character: '@', width: 12, height: 12, x_offset: 0, y_offset: 1, x_advance: 12, data_offset: 957, }, GlyphInfo { character: 'A', width: 9, height: 11, x_offset: 0, y_offset: 0, x_advance: 9, data_offset: 1029, }, GlyphInfo { character: 'B', width: 8, height: 10, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1079, }, GlyphInfo { character: 'C', width: 9, height: 12, x_offset: 0, y_offset: 0, x_advance: 9, data_offset: 1119, }, GlyphInfo { character: 'D', width: 9, height: 10, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 1173, }, GlyphInfo { character: 'E', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1218, }, GlyphInfo { character: 'F', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 7, data_offset: 1248, }, GlyphInfo { character: 'G', width: 10, height: 12, x_offset: 0, y_offset: 0, x_advance: 10, data_offset: 1278, }, GlyphInfo { character: 'H', width: 8, height: 10, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 1338, }, GlyphInfo { character: 'I', width: 4, height: 10, x_offset: 0, y_offset: 1, x_advance: 4, data_offset: 1378, }, GlyphInfo { character: 'J', width: 5, height: 13, x_offset: -2, y_offset: 1, x_advance: 4, data_offset: 1398, }, GlyphInfo { character: 'K', width: 8, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1431, }, GlyphInfo { character: 'L', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 7, data_offset: 1471, }, GlyphInfo { character: 'M', width: 10, height: 10, x_offset: 1, y_offset: 1, x_advance: 12, data_offset: 1501, }, GlyphInfo { character: 'N', width: 8, height: 10, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 1551, }, GlyphInfo { character: 'O', width: 10, height: 12, x_offset: 0, y_offset: 0, x_advance: 11, data_offset: 1591, }, GlyphInfo { character: 'P', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1651, }, GlyphInfo { character: 'Q', width: 10, height: 14, x_offset: 0, y_offset: 0, x_advance: 11, data_offset: 1686, }, GlyphInfo { character: 'R', width: 8, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1756, }, GlyphInfo { character: 'S', width: 7, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1796, }, GlyphInfo { character: 'T', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 7, data_offset: 1838, }, GlyphInfo { character: 'U', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 1878, }, GlyphInfo { character: 'V', width: 9, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1922, }, GlyphInfo { character: 'W', width: 13, height: 10, x_offset: 0, y_offset: 1, x_advance: 13, data_offset: 1967, }, GlyphInfo { character: 'X', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 2032, }, GlyphInfo { character: 'Y', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 7, data_offset: 2072, }, GlyphInfo { character: 'Z', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 2112, }, GlyphInfo { character: '[', width: 4, height: 13, x_offset: 1, y_offset: 1, x_advance: 5, data_offset: 2152, }, GlyphInfo { character: '\\', width: 5, height: 10, x_offset: 0, y_offset: 1, x_advance: 5, data_offset: 2178, }, GlyphInfo { character: ']', width: 4, height: 13, x_offset: 0, y_offset: 1, x_advance: 5, data_offset: 2203, }, GlyphInfo { character: '^', width: 8, height: 8, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 2229, }, GlyphInfo { character: '_', width: 7, height: 1, x_offset: -1, y_offset: 12, x_advance: 6, data_offset: 2261, }, GlyphInfo { character: '`', width: 4, height: 3, x_offset: 0, y_offset: 0, x_advance: 4, data_offset: 2265, }, GlyphInfo { character: 'a', width: 7, height: 9, x_offset: 0, y_offset: 3, x_advance: 8, data_offset: 2271, }, GlyphInfo { character: 'b', width: 7, height: 12, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 2303, }, GlyphInfo { character: 'c', width: 7, height: 9, x_offset: 0, y_offset: 3, x_advance: 7, data_offset: 2345, }, GlyphInfo { character: 'd', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 2377, }, GlyphInfo { character: 'e',
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/lib.rs
frostsnap_fonts/src/lib.rs
#![no_std] // Core font types pub mod gray4_font; pub use gray4_font::{GlyphInfo, Gray4Font}; // Font modules pub mod noto_sans_14_light; pub mod noto_sans_17_regular; pub mod noto_sans_18_light; pub mod noto_sans_18_medium; pub mod noto_sans_24_bold; pub mod noto_sans_mono_14_regular; pub mod noto_sans_mono_15_regular; pub mod noto_sans_mono_17_regular; pub mod noto_sans_mono_18_light; pub mod noto_sans_mono_24_bold; pub mod noto_sans_mono_28_bold; // Font exports pub use noto_sans_14_light::NOTO_SANS_14_LIGHT; pub use noto_sans_17_regular::NOTO_SANS_17_REGULAR; pub use noto_sans_18_light::NOTO_SANS_18_LIGHT; pub use noto_sans_18_medium::NOTO_SANS_18_MEDIUM; pub use noto_sans_24_bold::NOTO_SANS_24_BOLD; pub use noto_sans_mono_14_regular::NOTO_SANS_MONO_14_REGULAR; pub use noto_sans_mono_15_regular::NOTO_SANS_MONO_15_REGULAR; pub use noto_sans_mono_17_regular::NOTO_SANS_MONO_17_REGULAR; pub use noto_sans_mono_18_light::NOTO_SANS_MONO_18_LIGHT; pub use noto_sans_mono_24_bold::NOTO_SANS_MONO_24_BOLD; pub use noto_sans_mono_28_bold::NOTO_SANS_MONO_28_BOLD;
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/gray4_font.rs
frostsnap_fonts/src/gray4_font.rs
use embedded_graphics::{pixelcolor::Gray4, prelude::*}; /// Gray4 font format - 4-bit anti-aliased fonts with 16 levels of gray /// Glyph info - stores position in packed data array #[derive(Debug, Clone, Copy, PartialEq)] pub struct GlyphInfo { pub character: char, pub width: u8, pub height: u8, pub x_offset: i8, // Bearing X pub y_offset: i8, // Bearing Y pub x_advance: u8, // How far to advance after drawing pub data_offset: u32, // Offset into packed pixel data } /// Gray4 font - packed format for efficient storage #[derive(Clone, Debug, Copy, PartialEq)] pub struct Gray4Font { pub baseline: u32, pub line_height: u32, /// Packed pixel data - only contains actual glyph pixels /// Still 2 pixels per byte (4 bits each) pub packed_data: &'static [u8], /// Glyph lookup table pub glyphs: &'static [GlyphInfo], } impl Gray4Font { /// Binary search for a character pub fn get_glyph(&self, c: char) -> Option<&GlyphInfo> { self.glyphs .binary_search_by_key(&c, |g| g.character) .ok() .map(|idx| &self.glyphs[idx]) } /// Get pixel value at (x,y) within a glyph pub fn get_pixel(&self, glyph: &GlyphInfo, x: u32, y: u32) -> u8 { if x >= glyph.width as u32 || y >= glyph.height as u32 { return 0; } // Calculate position in packed data let pixel_index = y * glyph.width as u32 + x; let byte_index = glyph.data_offset + (pixel_index / 2); let byte = self.packed_data[byte_index as usize]; if pixel_index.is_multiple_of(2) { (byte >> 4) & 0x0F // High nibble } else { byte & 0x0F // Low nibble } } /// Get an iterator over all non-transparent pixels in a glyph pub fn glyph_pixels<'a>(&'a self, glyph: &'a GlyphInfo) -> GlyphPixelIterator<'a> { // Calculate how many bytes this glyph uses let total_pixels = glyph.width as usize * glyph.height as usize; let total_bytes = total_pixels.div_ceil(2); // Round up for odd number of pixels let start = glyph.data_offset as usize; let end = (start + total_bytes).min(self.packed_data.len()); GlyphPixelIterator { data: &self.packed_data[start..end], width: glyph.width, height: glyph.height, byte_index: 0, pixel_in_byte: 0, x: 0, y: 0, } } } /// Iterator that yields Pixel<Gray4> for each non-transparent pixel in a glyph pub struct GlyphPixelIterator<'a> { data: &'a [u8], // Slice of packed pixel data for this glyph width: u8, // Glyph width height: u8, // Glyph height byte_index: usize, // Current byte index in data slice pixel_in_byte: u8, // 0 or 1 (which pixel within the current byte) x: u8, // Current x position y: u8, // Current y position } impl<'a> Iterator for GlyphPixelIterator<'a> { type Item = Pixel<Gray4>; fn next(&mut self) -> Option<Self::Item> { while self.y < self.height { // Get current byte from packed data let byte = self.data[self.byte_index]; // Extract the pixel value from the current nibble let value = if self.pixel_in_byte == 0 { (byte >> 4) & 0x0F // High nibble } else { byte & 0x0F // Low nibble }; let point = Point::new(self.x as i32, self.y as i32); // Move to next pixel position self.x += 1; if self.x >= self.width { self.x = 0; self.y += 1; } // Move to next nibble self.pixel_in_byte += 1; if self.pixel_in_byte >= 2 { self.pixel_in_byte = 0; self.byte_index += 1; } // Return non-transparent pixels if value > 0 { let gray = Gray4::new(value); return Some(Pixel(point, gray)); } } None } } // Example of how much smaller this would be: // For ASCII (95 chars), assuming average glyph size of 15x20 pixels: // - Each glyph: 15*20 = 300 pixels = 150 bytes (4 bits per pixel) // - Total: 95 * 150 = 14,250 bytes (~14 KB) // - Plus glyph info: 95 * 12 bytes = 1,140 bytes // - Total: ~15 KB for Gray4 ASCII font (vs 524 KB for atlas!) // // For full Unicode (1000 chars): // - 1000 * 150 = 150,000 bytes for pixels // - 1000 * 12 = 12,000 bytes for glyph info // - Total: ~162 KB (vs 524 KB for atlas!)
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_15_regular.rs
frostsnap_fonts/src/noto_sans_mono_15_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 15px //! Weight: 400 //! Characters: 95 //! Line height: 16px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_15_REGULAR_DATA: &[u8] = &[ 0x6c, 0x67, 0xf7, 0x6f, 0x76, 0xf6, 0x5f, 0x55, 0xf5, 0x4f, 0x43, 0xe3, 0x00, 0x06, 0xd6, 0x8f, 0x80, 0x30, 0x9a, 0x0a, 0x8a, 0xc0, 0xca, 0x9b, 0x0b, 0x98, 0xb0, 0xb8, 0x23, 0x03, 0x20, 0x00, 0x08, 0x80, 0x97, 0x00, 0x00, 0xc8, 0x0c, 0x70, 0x00, 0x0d, 0x60, 0xe4, 0x03, 0xaa, 0xfa, 0xae, 0xa8, 0x39, 0xbd, 0x9c, 0xd9, 0x70, 0x09, 0xb0, 0xaa, 0x00, 0x45, 0xca, 0x5c, 0x95, 0x1b, 0xde, 0xdd, 0xfd, 0xd5, 0x02, 0xe2, 0x4e, 0x00, 0x00, 0x6d, 0x08, 0xc0, 0x00, 0x08, 0xb0, 0xaa, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x17, 0xe6, 0x30, 0x5d, 0xee, 0xee, 0x6b, 0xc4, 0xe0, 0x61, 0xca, 0x3e, 0x00, 0x0a, 0xe9, 0xe0, 0x00, 0x19, 0xee, 0xc7, 0x00, 0x03, 0xeb, 0xe9, 0x00, 0x3e, 0x0b, 0xc4, 0x03, 0xe1, 0xcb, 0xbe, 0xce, 0xed, 0x43, 0x79, 0xe7, 0x20, 0x00, 0x2d, 0x00, 0x00, 0x5c, 0xc7, 0x00, 0x98, 0x0c, 0x96, 0xe3, 0x3e, 0x50, 0xe4, 0x0d, 0x7a, 0xb0, 0x0d, 0x61, 0xe6, 0xe5, 0x00, 0x8d, 0xcc, 0xab, 0x00, 0x00, 0x45, 0x3e, 0x50, 0x00, 0x00, 0x0a, 0xb9, 0xdd, 0x50, 0x03, 0xe7, 0xe4, 0x8d, 0x00, 0xab, 0x7d, 0x05, 0xe0, 0x3e, 0x55, 0xe2, 0x7d, 0x0a, 0xb0, 0x0a, 0xde, 0x70, 0x00, 0x00, 0x03, 0x20, 0x00, 0xad, 0xc5, 0x00, 0x00, 0x8e, 0x6b, 0xd0, 0x00, 0x09, 0xc0, 0x7e, 0x00, 0x00, 0x7e, 0x2c, 0xc0, 0x00, 0x00, 0xdf, 0xd3, 0x00, 0x00, 0x4e, 0xf8, 0x01, 0x62, 0x1c, 0xc9, 0xe5, 0x6e, 0x27, 0xe3, 0x0b, 0xdb, 0xc0, 0x8e, 0x00, 0x2f, 0xf6, 0x05, 0xf9, 0x27, 0xff, 0xa0, 0x0a, 0xef, 0xe9, 0x7e, 0x70, 0x02, 0x41, 0x00, 0x00, 0x4c, 0x44, 0xf4, 0x2f, 0x20, 0xe0, 0x04, 0x00, 0x02, 0xc5, 0x0b, 0xc0, 0x4e, 0x60, 0xad, 0x00, 0xcb, 0x00, 0xe9, 0x00, 0xe8, 0x00, 0xe8, 0x00, 0xd9, 0x00, 0xcc, 0x00, 0x9e, 0x20, 0x2e, 0x80, 0x09, 0xd2, 0x00, 0x84, 0x5c, 0x30, 0x0c, 0xb0, 0x06, 0xe4, 0x00, 0xda, 0x00, 0xbc, 0x00, 0x9e, 0x00, 0x8e, 0x00, 0x8e, 0x00, 0x9d, 0x00, 0xcb, 0x02, 0xe8, 0x08, 0xe2, 0x2d, 0x80, 0x48, 0x00, 0x00, 0x15, 0x10, 0x00, 0x02, 0xf2, 0x00, 0x31, 0x0e, 0x01, 0x3a, 0xec, 0xec, 0xeb, 0x04, 0xbe, 0xb5, 0x10, 0x6e, 0x6e, 0x70, 0x08, 0xa0, 0xa9, 0x00, 0x00, 0x1d, 0x20, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x2f, 0x30, 0x0b, 0xdd, 0xfd, 0xdb, 0x66, 0x7f, 0x76, 0x60, 0x02, 0xf3, 0x00, 0x00, 0x2f, 0x30, 0x00, 0x00, 0x51, 0x00, 0x4e, 0xa7, 0xf7, 0xae, 0x1c, 0xa0, 0x32, 0x00, 0xab, 0xbb, 0xa9, 0xaa, 0xa9, 0x6d, 0x68, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x5c, 0x20, 0x00, 0x0a, 0xc0, 0x00, 0x01, 0xe8, 0x00, 0x00, 0x8e, 0x20, 0x00, 0x0c, 0xb0, 0x00, 0x04, 0xe6, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x06, 0xe3, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x2e, 0x70, 0x00, 0x00, 0x00, 0x6c, 0xdc, 0x60, 0x00, 0x5e, 0xb8, 0xbf, 0x50, 0x0b, 0xc0, 0x09, 0xfb, 0x00, 0xe8, 0x03, 0xec, 0xe0, 0x2f, 0x60, 0xbc, 0x5f, 0x13, 0xf5, 0x6e, 0x54, 0xf3, 0x2f, 0x6d, 0xa0, 0x5f, 0x20, 0xec, 0xe2, 0x07, 0xe0, 0x0c, 0xf8, 0x00, 0xac, 0x00, 0x7f, 0x73, 0x7e, 0x80, 0x00, 0x9e, 0xfe, 0xa0, 0x00, 0x00, 0x14, 0x20, 0x00, 0x00, 0x6b, 0x80, 0x05, 0xce, 0xea, 0x00, 0x5b, 0x4c, 0xa0, 0x00, 0x00, 0xca, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00, 0xca, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00, 0xca, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00, 0xdb, 0x00, 0x0e, 0xef, 0xfe, 0xc0, 0x29, 0xcd, 0xc7, 0x00, 0xbe, 0x98, 0xce, 0x50, 0x33, 0x00, 0x1d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x4e, 0x80, 0x00, 0x00, 0xcd, 0x10, 0x00, 0x0b, 0xe5, 0x00, 0x00, 0xae, 0x60, 0x00, 0x0a, 0xe6, 0x00, 0x00, 0xbe, 0x86, 0x66, 0x62, 0xef, 0xff, 0xff, 0xf5, 0x3a, 0xcd, 0xc7, 0x0b, 0xd9, 0x8c, 0xe6, 0x20, 0x00, 0x1e, 0xa0, 0x00, 0x01, 0xe9, 0x02, 0x56, 0xcd, 0x20, 0x7f, 0xfd, 0x60, 0x01, 0x34, 0x8e, 0x80, 0x00, 0x00, 0xad, 0x00, 0x00, 0x0b, 0xda, 0x63, 0x38, 0xea, 0xbe, 0xff, 0xea, 0x10, 0x24, 0x41, 0x00, 0x00, 0x00, 0x3c, 0xa0, 0x00, 0x00, 0x0b, 0xec, 0x00, 0x00, 0x06, 0xeb, 0xc0, 0x00, 0x01, 0xd9, 0xbc, 0x00, 0x00, 0x9d, 0x1b, 0xc0, 0x00, 0x4e, 0x60, 0xbc, 0x00, 0x0b, 0xb0, 0x0b, 0xc0, 0x05, 0xfb, 0xaa, 0xdd, 0xa5, 0x5b, 0xbb, 0xbd, 0xdb, 0x50, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x0b, 0xc0, 0x00, 0x5c, 0xcc, 0xcc, 0x47, 0xea, 0xaa, 0xa3, 0x8e, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0xad, 0xaa, 0x82, 0x07, 0xca, 0xbe, 0xd3, 0x00, 0x00, 0x3e, 0xa0, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x0c, 0xc9, 0x63, 0x4a, 0xf7, 0xae, 0xff, 0xe8, 0x00, 0x14, 0x40, 0x00, 0x00, 0x08, 0xcd, 0xd5, 0x00, 0x0b, 0xea, 0x78, 0x40, 0x08, 0xe5, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x0e, 0x89, 0xcc, 0x80, 0x01, 0xed, 0xa7, 0x9e, 0x90, 0x3f, 0xa0, 0x00, 0x9e, 0x01, 0xe7, 0x00, 0x06, 0xf2, 0x0d, 0xa0, 0x00, 0x8e, 0x10, 0x8e, 0x71, 0x5d, 0xb0, 0x00, 0xae, 0xee, 0xb2, 0x00, 0x00, 0x24, 0x20, 0x00, 0x3c, 0xcc, 0xcc, 0xcc, 0x32, 0xaa, 0xaa, 0xac, 0xe2, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x5e, 0x50, 0x00, 0x00, 0x0b, 0xc0, 0x00, 0x00, 0x02, 0xe8, 0x00, 0x00, 0x00, 0x9e, 0x10, 0x00, 0x00, 0x1d, 0xa0, 0x00, 0x00, 0x07, 0xe4, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x5f, 0x60, 0x00, 0x00, 0x07, 0xcd, 0xc7, 0x07, 0xea, 0x7a, 0xe7, 0xbc, 0x00, 0x0c, 0xb9, 0xd2, 0x02, 0xe9, 0x2d, 0xd8, 0xdc, 0x20, 0x6e, 0xee, 0x50, 0x7e, 0x83, 0xae, 0x6d, 0xa0, 0x00, 0xad, 0xe8, 0x00, 0x09, 0xec, 0xd4, 0x05, 0xdb, 0x3c, 0xee, 0xeb, 0x30, 0x03, 0x42, 0x00, 0x00, 0x8c, 0xdc, 0x60, 0x00, 0x9e, 0x97, 0xbe, 0x60, 0x0e, 0x90, 0x00, 0xbc, 0x03, 0xf6, 0x00, 0x07, 0xe0, 0x0e, 0x70, 0x00, 0x8f, 0x30, 0xbd, 0x51, 0x7d, 0xf3, 0x03, 0xbe, 0xec, 0x9e, 0x00, 0x00, 0x01, 0x0a, 0xd0, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x12, 0x16, 0xcd, 0x20, 0x03, 0xff, 0xec, 0x40, 0x00, 0x04, 0x42, 0x00, 0x00, 0x04, 0x08, 0xf8, 0x6c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xd6, 0x8f, 0x70, 0x30, 0x03, 0x12, 0xec, 0x1c, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xea, 0x7f, 0x7a, 0xe1, 0xca, 0x03, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, 0x9b, 0x00, 0x08, 0xdc, 0x50, 0x6d, 0xd6, 0x00, 0xae, 0x80, 0x00, 0x06, 0xce, 0x92, 0x00, 0x00, 0x6c, 0xe9, 0x20, 0x00, 0x06, 0xcb, 0x00, 0x00, 0x00, 0x30, 0x77, 0x77, 0x77, 0x7d, 0xee, 0xee, 0xed, 0x00, 0x00, 0x00, 0x09, 0x99, 0x99, 0x99, 0xcc, 0xcc, 0xcc, 0xc0, 0x10, 0x00, 0x00, 0x0b, 0x92, 0x00, 0x00, 0x5c, 0xd8, 0x00, 0x00, 0x06, 0xdd, 0x60, 0x00, 0x00, 0x8e, 0xa0, 0x02, 0x9e, 0xc6, 0x29, 0xec, 0x60, 0x0b, 0xc6, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x5a, 0xdd, 0xc7, 0x08, 0xc9, 0x8a, 0xe7, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0xca, 0x00, 0x00, 0x8e, 0x50, 0x00, 0x9e, 0x70, 0x00, 0x7e, 0x50, 0x00, 0x0a, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0xce, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x3a, 0xbb, 0x60, 0x00, 0x5e, 0xb8, 0x9d, 0x90, 0x1d, 0x80, 0x00, 0x4e, 0x47, 0xd0, 0x8c, 0xc8, 0xba, 0xaa, 0x7e, 0x6b, 0xb8, 0xcc, 0x8b, 0xa0, 0xab, 0x7c, 0xc7, 0xc9, 0x0b, 0xa7, 0xcc, 0x8b, 0xa0, 0xda, 0x9a, 0xaa, 0x7e, 0xca, 0xdd, 0x57, 0xd1, 0x57, 0x15, 0x60, 0x0c, 0xb2, 0x00, 0x13, 0x00, 0x2c, 0xec, 0xce, 0x80, 0x00, 0x04, 0x77, 0x30, 0x00, 0x00, 0x07, 0xc6, 0x00, 0x00, 0x00, 0xbe, 0xb0, 0x00, 0x00, 0x1e, 0xbe, 0x10, 0x00, 0x07, 0xe3, 0xe7, 0x00, 0x00, 0xbc, 0x0c, 0xb0, 0x00, 0x1e, 0x80, 0x8e, 0x10, 0x06, 0xfa, 0xab, 0xf6, 0x00, 0xbf, 0xcc, 0xcf, 0xa0, 0x0e, 0x90, 0x00, 0x9e, 0x06, 0xf4, 0x00, 0x05, 0xf6, 0xad, 0x00, 0x00, 0x0d, 0xa0, 0x9c, 0xcc, 0xb7, 0x00, 0xbd, 0x9a, 0xbe, 0x90, 0xbc, 0x00, 0x0b, 0xd0, 0xbc, 0x00, 0x0a, 0xd0, 0xbc, 0x56, 0x8e, 0x80, 0xbe, 0xee, 0xea, 0x20, 0xbc, 0x00, 0x4c, 0xc0, 0xbc, 0x00, 0x07, 0xf4, 0xbc, 0x00, 0x08, 0xf4, 0xbc, 0x55, 0x8d, 0xc0, 0xbf, 0xff, 0xeb, 0x30, 0x00, 0x18, 0xcd, 0xca, 0x20, 0x0c, 0xea, 0x89, 0xc1, 0x08, 0xe6, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x0e, 0xa0, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x0a, 0xe2, 0x00, 0x00, 0x00, 0x3e, 0xd7, 0x46, 0x80, 0x00, 0x5c, 0xff, 0xeb, 0x00, 0x00, 0x02, 0x42, 0x00, 0xcc, 0xcb, 0x81, 0x00, 0xec, 0x9b, 0xed, 0x30, 0xe9, 0x00, 0x4e, 0xb0, 0xe9, 0x00, 0x09, 0xe2, 0xe9, 0x00, 0x05, 0xf6, 0xe9, 0x00, 0x03, 0xf7, 0xe9, 0x00, 0x04, 0xf6, 0xe9, 0x00, 0x08, 0xe3, 0xe9, 0x00, 0x1d, 0xc0, 0xea, 0x58, 0xde, 0x40, 0xef, 0xed, 0xb4, 0x00, 0x9c, 0xcc, 0xcc, 0xab, 0xea, 0xaa, 0xa8, 0xbd, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0xbd, 0x55, 0x55, 0x3b, 0xff, 0xff, 0xf9, 0xbd, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x0b, 0xd6, 0x66, 0x65, 0xbf, 0xff, 0xff, 0xc0, 0x9c, 0xcc, 0xcc, 0xab, 0xea, 0xaa, 0xa8, 0xbd, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x0b, 0xec, 0xcc, 0xc7, 0xbe, 0x99, 0x99, 0x6b, 0xd0, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x3a, 0xcd, 0xc7, 0x04, 0xdd, 0xa9, 0xa9, 0x0b, 0xd3, 0x00, 0x00, 0x2e, 0x90, 0x00, 0x00, 0x6f, 0x50, 0x00, 0x00, 0x7f, 0x30, 0x6b, 0xbb, 0x7f, 0x40, 0x5a, 0xce, 0x5f, 0x70, 0x00, 0x8e, 0x0e, 0xb0, 0x00, 0x8e, 0x08, 0xfa, 0x43, 0xae, 0x00, 0x8e, 0xff, 0xec, 0x00, 0x00, 0x34, 0x10, 0xc7, 0x00, 0x07, 0xce, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xea, 0x55, 0x5a, 0xee, 0xff, 0xff, 0xfe, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xe0, 0x6c, 0xcc, 0xcc, 0x63, 0x7a, 0xf9, 0x73, 0x00, 0x5f, 0x50, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x17, 0xf6, 0x10, 0x8e, 0xff, 0xfe, 0x80, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0xae, 0x67, 0x47, 0xeb, 0x8e, 0xff, 0xc3, 0x01, 0x43, 0x00, 0xc7, 0x00, 0x0a, 0xb1, 0xe9, 0x00, 0x8e, 0x60, 0xe9, 0x04, 0xe9, 0x00, 0xe9, 0x1d, 0xc1, 0x00, 0xe9, 0xae, 0x40, 0x00, 0xeb, 0xec, 0x00, 0x00, 0xee, 0x8e, 0x80, 0x00, 0xea, 0x0a, 0xe3, 0x00, 0xe9, 0x01, 0xdb, 0x00, 0xe9, 0x00, 0x6e, 0x70, 0xe9, 0x00, 0x0b, 0xd2, 0x6c, 0x20, 0x00, 0x07, 0xf3, 0x00, 0x00, 0x7f, 0x30, 0x00, 0x07, 0xf3, 0x00, 0x00, 0x7f, 0x30, 0x00, 0x07, 0xf3, 0x00, 0x00, 0x7f, 0x30, 0x00, 0x07, 0xf3, 0x00, 0x00, 0x7f, 0x30, 0x00, 0x07, 0xf7, 0x66, 0x65, 0x7f, 0xff, 0xff, 0xc0, 0x5c, 0xa0, 0x00, 0xac, 0x56, 0xee, 0x20, 0x3e, 0xe6, 0x6e, 0xd7, 0x08, 0xde, 0x66, 0xea, 0xb0, 0xba, 0xe6, 0x6f, 0x7d, 0x0e, 0x7f, 0x66, 0xf2, 0xe8, 0xe2, 0xf6, 0x6f, 0x2c, 0xdb, 0x2f, 0x66, 0xf2, 0x8f, 0x82, 0xf6, 0x6f, 0x22, 0x82, 0x2f, 0x66, 0xf2, 0x00, 0x02, 0xf6, 0x6f, 0x20, 0x00, 0x2f, 0x60, 0xcc, 0x10, 0x06, 0xce, 0xe8, 0x00, 0x8e, 0xeb, 0xd0, 0x08, 0xee, 0x8e, 0x60, 0x8e, 0xe8, 0xac, 0x08, 0xee, 0x84, 0xe4, 0x8e, 0xe8, 0x0b, 0xa8, 0xee, 0x80, 0x6e, 0x8e, 0xe8, 0x00, 0xdc, 0xee, 0x80, 0x08, 0xee, 0xe8, 0x00, 0x1e, 0xe0, 0x00, 0x7c, 0xdc, 0x70, 0x00, 0x7e, 0xb8, 0xae, 0x70, 0x0d, 0xb0, 0x00, 0xbd, 0x04, 0xf7, 0x00, 0x07, 0xf3, 0x7f, 0x40, 0x00, 0x5f, 0x67, 0xf3, 0x00, 0x03, 0xf7, 0x6f, 0x40, 0x00, 0x4f, 0x65, 0xf6, 0x00, 0x06, 0xf4, 0x1e, 0xa0, 0x00, 0xae, 0x00, 0x9e, 0x73, 0x7e, 0x90, 0x01, 0xae, 0xfe, 0xa0, 0x00, 0x00, 0x24, 0x20, 0x00, 0x9c, 0xcc, 0xb8, 0x00, 0xbd, 0x99, 0xbe, 0xa0, 0xbd, 0x00, 0x09, 0xe2, 0xbd, 0x00, 0x06, 0xf4, 0xbd, 0x00, 0x09, 0xe2, 0xbd, 0x77, 0xae, 0xa0, 0xbe, 0xdd, 0xc8, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xdc, 0x70, 0x00, 0x7e, 0xb8, 0xae, 0x70, 0x0d, 0xb0, 0x00, 0xbd, 0x04, 0xf7, 0x00, 0x07, 0xf3, 0x7f, 0x40, 0x00, 0x5f, 0x67, 0xf3, 0x00, 0x03, 0xf7, 0x6f, 0x40, 0x00, 0x4f, 0x65, 0xf6, 0x00, 0x06, 0xf4, 0x1e, 0xa0, 0x00, 0xae, 0x00, 0x9e, 0x73, 0x8e, 0x90, 0x01, 0xae, 0xff, 0xe0, 0x00, 0x00, 0x24, 0xae, 0x20, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x08, 0xb1, 0x9c, 0xcb, 0xa4, 0x00, 0xbd, 0x9a, 0xde, 0x50, 0xbd, 0x00, 0x2e, 0xb0, 0xbd, 0x00, 0x0c, 0xb0, 0xbd, 0x00, 0x3e, 0x90, 0xbe, 0xab, 0xec, 0x10, 0xbe, 0xbd, 0xd1, 0x00, 0xbd, 0x03, 0xe9, 0x00, 0xbd, 0x00, 0x9e, 0x30, 0xbd, 0x00, 0x1d, 0xb0, 0xbd, 0x00, 0x07, 0xe6, 0x05, 0xbd, 0xdb, 0x74, 0xec, 0x99, 0xb8, 0x9e, 0x20, 0x00, 0x09, 0xe2, 0x00, 0x00, 0x4e, 0xc6, 0x00, 0x00, 0x5c, 0xfc, 0x60, 0x00, 0x06, 0xce, 0x80, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x0a, 0xd8, 0x73, 0x26, 0xeb, 0xae, 0xff, 0xeb, 0x20, 0x13, 0x41, 0x00, 0x6c, 0xcc, 0xcc, 0xcc, 0x65, 0xaa, 0xbf, 0xba, 0xa5, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0xc7, 0x00, 0x07, 0xce, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xe9, 0x00, 0x09, 0xee, 0x90, 0x00, 0x9e, 0xdb, 0x00, 0x0b, 0xda, 0xe7, 0x37, 0xe9, 0x2b, 0xef, 0xeb, 0x10, 0x02, 0x42, 0x00, 0x8b, 0x00, 0x00, 0x0b, 0x86, 0xf5, 0x00, 0x05, 0xf6, 0x1e, 0x90, 0x00, 0x9e, 0x10, 0xbc, 0x00, 0x0c, 0xb0, 0x07, 0xe3, 0x02, 0xe7, 0x00, 0x1e, 0x80, 0x7e, 0x20, 0x00, 0xbb, 0x0b, 0xb0, 0x00, 0x07, 0xe1, 0xe8, 0x00, 0x00, 0x2e, 0x8e, 0x20, 0x00, 0x00, 0xbd, 0xc0, 0x00, 0x00, 0x08, 0xf8, 0x00, 0x00, 0x99, 0x00, 0x00, 0x09, 0x9a, 0xc0, 0x00, 0x00, 0xca, 0x8d, 0x00, 0x20, 0x0d, 0x97, 0xe0, 0x7f, 0x70, 0xe7, 0x5e, 0x1a, 0xda, 0x0e, 0x62, 0xf4, 0xca, 0xc3, 0xf4, 0x0e, 0x6e, 0x3e, 0x5e, 0x10, 0xd9, 0xd0, 0xc9, 0xe0, 0x0c, 0xcb, 0x0a, 0xcd, 0x00, 0xbe, 0x80, 0x7e, 0xc0, 0x09, 0xf4, 0x02, 0xeb, 0x00, 0x2c, 0x70, 0x00, 0x7c, 0x20, 0xad, 0x10, 0x1d, 0xa0, 0x02, 0xd9, 0x09, 0xe2, 0x00, 0x07, 0xe4, 0xe8, 0x00, 0x00, 0x0c, 0xec, 0x00, 0x00, 0x00, 0x7f, 0x70, 0x00, 0x00, 0x0c, 0xec, 0x00, 0x00, 0x08, 0xe4, 0xe8, 0x00, 0x02, 0xe9, 0x08, 0xe2, 0x00, 0xad, 0x10, 0x0d, 0xa0, 0x5e, 0x70, 0x00, 0x6e, 0x50, 0x6c, 0x40, 0x00, 0x4c, 0x61, 0xdb, 0x00, 0x0a, 0xd1, 0x08, 0xe3, 0x02, 0xe8, 0x00, 0x1d, 0xa0, 0x9d, 0x10, 0x00, 0x8e, 0x3e, 0x80, 0x00, 0x00, 0xdc, 0xd0, 0x00, 0x00, 0x07, 0xf7, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x00, 0x5f, 0x50, 0x00, 0x00, 0x05, 0xf5, 0x00, 0x00, 0x6c, 0xcc, 0xcc, 0x94, 0x99, 0x99, 0xe9, 0x00, 0x00, 0x9e, 0x20, 0x00, 0x2e, 0x80, 0x00, 0x0a, 0xd1, 0x00, 0x04, 0xe7, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x6e, 0x50, 0x00, 0x0c, 0xb0, 0x00, 0x08, 0xe7, 0x66, 0x64, 0xbf, 0xff, 0xff, 0xb0, 0x7c, 0xcc, 0x9e, 0x88, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9e, 0xcc, 0x58, 0x88, 0x2c, 0x50, 0x00, 0x00, 0xca, 0x00, 0x00, 0x08, 0xe1, 0x00, 0x00, 0x2e, 0x70, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x06, 0xe4, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x03, 0xe6, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0x7e, 0x20, 0xcc, 0xc7, 0x88, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0x00, 0xe9, 0xcc, 0xe9, 0x88, 0x85, 0x00, 0x05, 0xc1, 0x00, 0x00, 0x00, 0xbe, 0x80, 0x00, 0x00, 0x4e, 0x6d, 0x10, 0x00, 0x0b, 0xa0, 0xc9, 0x00, 0x04, 0xe3, 0x05, 0xe2, 0x00, 0xab, 0x00, 0x0c, 0x90, 0x3e, 0x50, 0x00, 0x5e, 0x30, 0xee, 0xee, 0xee, 0xee, 0xe7, 0x77, 0x77, 0x77, 0x77, 0x29, 0x70, 0x0a, 0xe3, 0x00, 0xaa, 0x00, 0x25, 0x20, 0x05, 0xde, 0xee, 0xb1, 0x28, 0x20, 0x5e, 0x90, 0x00, 0x00, 0xbb, 0x19, 0xcd, 0xde, 0xbb, 0xd8, 0x54, 0xbb, 0xe9, 0x00, 0x0c, 0xbd, 0xb1, 0x39, 0xeb, 0x7e, 0xee, 0xba, 0xb0, 0x14, 0x20, 0x00, 0x76, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xda, 0x04, 0x40, 0x00, 0xdb, 0xde, 0xfc, 0x30, 0xde, 0x80, 0x4d, 0xb0, 0xdc, 0x00, 0x09, 0xe2, 0xda, 0x00, 0x06, 0xf5, 0xda, 0x00, 0x07, 0xf4, 0xdc, 0x00, 0x09, 0xe0, 0xde, 0x81, 0x5d, 0xa0, 0xd9, 0xde, 0xfc, 0x30, 0x00, 0x04, 0x30, 0x00, 0x00, 0x04, 0x52, 0x00, 0x7d, 0xff, 0xe8, 0x5e, 0xb3, 0x16, 0x4a, 0xd1, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x00, 0xad, 0x10, 0x00, 0x05, 0xea, 0x32, 0x55, 0x08, 0xef, 0xfe, 0x80, 0x00, 0x44, 0x10, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xad, 0x00, 0x04, 0x41, 0xad, 0x03, 0xcf, 0xed, 0xbd, 0x0c, 0xe5, 0x07, 0xed, 0x2e, 0x90, 0x00, 0xcd, 0x4f, 0x70, 0x00, 0xbd, 0x4f, 0x60, 0x00, 0xad, 0x1e, 0x90, 0x00, 0xcd, 0x0b, 0xd5, 0x18, 0xed, 0x03, 0xce, 0xed, 0x9d, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x53, 0x00, 0x00, 0x0a, 0xee, 0xec, 0x20, 0x09, 0xe7, 0x04, 0xdb, 0x00, 0xda, 0x00, 0x09, 0xe0, 0x2f, 0xed, 0xdd, 0xef, 0x32, 0xf9, 0x66, 0x66, 0x61, 0x0d, 0xa0, 0x00, 0x00, 0x00, 0x9e, 0x82, 0x15, 0x80, 0x00, 0x9e, 0xee, 0xea, 0x00, 0x00, 0x14, 0x41, 0x00, 0x00, 0x00, 0x27, 0x98, 0x40, 0x00, 0x3d, 0xec, 0xc7, 0x00, 0x08, 0xf4, 0x00, 0x00, 0x00, 0x9e, 0x22, 0x20, 0x1e, 0xef, 0xff, 0xff, 0x00, 0x33, 0x9e, 0x33, 0x30, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x04, 0x51, 0x12, 0x03, 0xcf, 0xed, 0xad, 0x0b, 0xd5, 0x06, 0xed, 0x1e, 0x90, 0x00, 0xbd, 0x4f, 0x60, 0x00, 0x9d, 0x4f, 0x70, 0x00, 0x9d, 0x1e, 0x90, 0x00, 0xbd, 0x0b, 0xe5, 0x06, 0xed, 0x03, 0xcf, 0xed, 0xbd, 0x00, 0x03, 0x40, 0xac, 0x01, 0x00, 0x00, 0xcb, 0x0c, 0xb9, 0x9c, 0xe5, 0x05, 0x9b, 0xba, 0x40, 0x76, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0xda, 0x00, 0x00, 0x0d, 0xa0, 0x44, 0x00, 0xda, 0xce, 0xed, 0x4d, 0xe8, 0x04, 0xdb, 0xdc, 0x00, 0x0a, 0xdd, 0xb0, 0x00, 0x9d, 0xda, 0x00, 0x09, 0xdd, 0xa0, 0x00, 0x9d, 0xda, 0x00, 0x09, 0xdd, 0xa0, 0x00, 0x9d, 0x00, 0x17, 0x30, 0x00, 0x00, 0x7f, 0xa0, 0x00, 0x00, 0x29, 0x40, 0x00, 0x12, 0x22, 0x10, 0x00, 0xae, 0xff, 0x90, 0x00, 0x00, 0x2e, 0x90, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x01, 0x3e, 0x92, 0x00, 0xce, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x56, 0x00, 0x00, 0x0c, 0xe2, 0x00, 0x00, 0x68, 0x00, 0x02, 0x22, 0x20, 0x01, 0xee, 0xfe, 0x00, 0x00, 0x19, 0xe0, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x08, 0xe0, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x0b, 0xd0, 0x3b, 0x9b, 0xe9, 0x02, 0xab, 0xb7, 0x00, 0x58, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x01, 0x21, 0x9e, 0x00, 0x2c, 0xd2, 0x9e, 0x01, 0xcd, 0x30, 0x9e, 0x0b, 0xd4, 0x00, 0x9d, 0x9f, 0x80, 0x00, 0x9e, 0xdb, 0xd3, 0x00, 0x9e, 0x31, 0xdc, 0x00, 0x9e, 0x00, 0x5e, 0x90, 0x9e, 0x00, 0x08, 0xe6, 0x79, 0x99, 0x60, 0x00, 0x8b, 0xce, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x00, 0x0d, 0xa0, 0x00, 0x01, 0x3d, 0xa2, 0x00, 0xce, 0xff, 0xff, 0xe3, 0x12, 0x15, 0x11, 0x52, 0x06, 0xdd, 0xfb, 0xcf, 0xd0, 0x6f, 0x88, 0xfb, 0x5f, 0x56, 0xf2, 0x4f, 0x60, 0xe6, 0x6e, 0x03, 0xf4, 0x0e, 0x76, 0xe0, 0x3f, 0x40, 0xe7, 0x6e, 0x03, 0xf4, 0x0e, 0x76, 0xe0, 0x3f, 0x40, 0xe7, 0x6e, 0x03, 0xf4, 0x0e, 0x70, 0x21, 0x04, 0x41, 0x0d, 0x9c, 0xee, 0xd5, 0xde, 0x80, 0x3d, 0xcd, 0xc0, 0x00, 0xad, 0xdb, 0x00, 0x09, 0xdd, 0xa0, 0x00, 0x9d, 0xda, 0x00, 0x09, 0xdd, 0xa0, 0x00, 0x9d, 0xda, 0x00, 0x09, 0xd0, 0x00, 0x03, 0x52, 0x00, 0x00, 0x2b, 0xee, 0xeb, 0x20, 0x0b, 0xe5, 0x05, 0xea, 0x01, 0xe9, 0x00, 0x09, 0xe1, 0x4f, 0x60, 0x00, 0x6f, 0x44, 0xf6, 0x00, 0x06, 0xf4, 0x1e, 0x90, 0x00, 0x9e, 0x10, 0xae, 0x50, 0x5e, 0xa0, 0x01, 0xae, 0xee, 0xa1, 0x00, 0x00, 0x14, 0x10, 0x00, 0x21, 0x04, 0x40, 0x00, 0xda, 0xde, 0xfc, 0x30, 0xde, 0x70, 0x4d, 0xb0, 0xdc, 0x00, 0x08, 0xe2, 0xda, 0x00, 0x06, 0xf5, 0xdb, 0x00, 0x07, 0xf4, 0xdc, 0x00, 0x09, 0xe1, 0xde, 0x71, 0x5d, 0xb0, 0xdb, 0xce, 0xfc, 0x30, 0xda, 0x03, 0x30, 0x00, 0xda, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x04, 0x50, 0x12, 0x03, 0xcf, 0xed, 0x9d, 0x0b, 0xd4, 0x07, 0xed, 0x2e, 0x90, 0x00, 0xcd, 0x5f, 0x60, 0x00, 0xbd, 0x4f, 0x60, 0x00, 0xad, 0x0e, 0x90, 0x00, 0xcd, 0x0b, 0xe5, 0x17, 0xed, 0x03, 0xcf, 0xed, 0xbd, 0x00, 0x03, 0x40, 0xad, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x79, 0x02, 0x22, 0x10, 0x44, 0x00, 0xce, 0xfa, 0xbf, 0xf9, 0x00, 0x1b, 0xec, 0x44, 0x30, 0x00, 0xbe, 0x30, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x0b, 0xc0, 0x00, 0x00, 0x02, 0xbc, 0x20, 0x00, 0x2e, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x14, 0x41, 0x00, 0xbe, 0xee, 0xe4, 0x6f, 0x60, 0x16, 0x05, 0xf8, 0x00, 0x00, 0x09, 0xec, 0x71, 0x00, 0x03, 0xae, 0xd3, 0x00, 0x00, 0x3e, 0x86, 0x72, 0x06, 0xe7, 0x7e, 0xfe, 0xea, 0x00, 0x03, 0x42, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x0d, 0x80, 0x00, 0x00, 0x1e, 0x92, 0x21, 0x4e, 0xef, 0xff, 0xfa, 0x13, 0x3e, 0x93, 0x32, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x0e, 0x90, 0x00, 0x00, 0x0d, 0xc3, 0x03, 0x00, 0x06, 0xee, 0xec, 0x00, 0x00, 0x03, 0x41, 0x21, 0x00, 0x01, 0x2d, 0x90, 0x00, 0xad, 0xd9, 0x00, 0x0a, 0xdd, 0x90, 0x00, 0xad, 0xd9, 0x00, 0x0a, 0xdd, 0x90, 0x00, 0xbd, 0xda, 0x00, 0x0c, 0xdc, 0xd4, 0x07, 0xed, 0x5d, 0xfe, 0xc9, 0xd0, 0x04, 0x30, 0x00, 0x12, 0x00, 0x00, 0x02, 0x14, 0xe6, 0x00, 0x07, 0xe4, 0x0c, 0xb0, 0x00, 0xbc, 0x00, 0x8e, 0x10, 0x2e, 0x80, 0x02, 0xe7, 0x07, 0xe2, 0x00, 0x0b, 0xb0, 0xbb, 0x00, 0x00, 0x7e, 0x4e, 0x60, 0x00, 0x01, 0xec, 0xd0, 0x00, 0x00, 0x0a, 0xfa, 0x00, 0x00, 0x21, 0x00, 0x00, 0x01, 0x2c, 0xb0, 0x00, 0x00, 0xac, 0xac, 0x05, 0xa5, 0x0c, 0xa8, 0xd0, 0xae, 0xa0, 0xd8, 0x6e, 0x1d, 0xbd, 0x1e, 0x62, 0xe7, 0xe4, 0xe6, 0xe2, 0x0d, 0xbc, 0x0d, 0xbd, 0x00, 0xcd, 0xa0, 0xad, 0xc0, 0x0a, 0xf6, 0x07, 0xfa, 0x00, 0x02, 0x10, 0x00, 0x12, 0x01, 0xcc, 0x00, 0x0c, 0xc1, 0x04, 0xe9, 0x09, 0xe4, 0x00, 0x07, 0xe8, 0xe7, 0x00, 0x00, 0x0b, 0xfa, 0x00, 0x00, 0x00, 0xce, 0xc0, 0x00, 0x00, 0x9e, 0x5e, 0x90, 0x00, 0x6e, 0x70, 0x7e, 0x60, 0x3e, 0xa0, 0x00, 0xad, 0x30, 0x12, 0x00, 0x00, 0x02, 0x14, 0xe6, 0x00, 0x06, 0xe4, 0x0c, 0xb0, 0x00, 0xbc, 0x00, 0x7e, 0x30, 0x1e, 0x80, 0x00, 0xd9, 0x06, 0xe2, 0x00, 0x09, 0xd0, 0xbb, 0x00, 0x00, 0x3e, 0x6e, 0x60, 0x00, 0x00, 0xbc, 0xd0, 0x00, 0x00, 0x05, 0xfa, 0x00, 0x00, 0x00, 0x4e, 0x50, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x01, 0x9a, 0xe6, 0x00, 0x00, 0x1b, 0xb7, 0x00, 0x00, 0x00, 0x12, 0x22, 0x22, 0x19, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x7e, 0x60, 0x00, 0x5e, 0x80, 0x00, 0x2d, 0xb0, 0x00, 0x0b, 0xd1, 0x00, 0x09, 0xe4, 0x00, 0x06, 0xe8, 0x55, 0x53, 0xbf, 0xff, 0xff, 0xb0, 0x00, 0x29, 0xb0, 0x0c, 0xd9, 0x02, 0xf7, 0x00, 0x3f, 0x60, 0x03, 0xf6, 0x00, 0x7e, 0x40, 0xce, 0x80, 0x08, 0xdc, 0x10, 0x04, 0xf6, 0x00, 0x3f, 0x60, 0x03, 0xf6, 0x00, 0x1e, 0x90, 0x00, 0xae, 0xc0, 0x00, 0x47, 0x19, 0x12, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xf3, 0x2f, 0x32, 0xb2, 0xb9, 0x20, 0x09, 0xdc, 0x00, 0x07, 0xf2, 0x00, 0x6f, 0x30, 0x06, 0xf3, 0x00, 0x4f, 0x60, 0x00, 0x9d, 0xc0, 0x1c, 0xd9, 0x06, 0xf4, 0x00, 0x6f, 0x30, 0x06, 0xf3, 0x00, 0x9e, 0x10, 0xce, 0x90, 0x07, 0x40, 0x00, 0x5d, 0xd6, 0x04, 0xcb, 0x76, 0xd9, 0xaa, 0xb2, 0x04, 0xba, 0x20, ]; /// Glyph metadata for binary search pub const NOTO_SANS_MONO_15_REGULAR_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 9, data_offset: 0, }, GlyphInfo { character: '!', width: 3, height: 12, x_offset: 3, y_offset: 1, x_advance: 9, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 5, x_offset: 2, y_offset: 1, x_advance: 9, data_offset: 18, }, GlyphInfo { character: '#', width: 9, height: 11, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 31, }, GlyphInfo { character: '$', width: 7, height: 13, x_offset: 1, y_offset: 0, x_advance: 9, data_offset: 81, }, GlyphInfo { character: '%', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 127, }, GlyphInfo { character: '&', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 181, }, GlyphInfo { character: '\'', width: 3, height: 5, x_offset: 3, y_offset: 1, x_advance: 9, data_offset: 235, }, GlyphInfo { character: '(', width: 4, height: 14, x_offset: 3, y_offset: 1, x_advance: 9, data_offset: 243, }, GlyphInfo { character: ')', width: 4, height: 14, x_offset: 2, y_offset: 1, x_advance: 9, data_offset: 271, }, GlyphInfo { character: '*', width: 7, height: 7, x_offset: 1, y_offset: 0, x_advance: 9, data_offset: 299, }, GlyphInfo { character: '+', width: 7, height: 8, x_offset: 1, y_offset: 3, x_advance: 9, data_offset: 324, }, GlyphInfo { character: ',', width: 3, height: 5, x_offset: 3, y_offset: 10, x_advance: 9, data_offset: 352, }, GlyphInfo { character: '-', width: 5, height: 2, x_offset: 2, y_offset: 7, x_advance: 9, data_offset: 360, }, GlyphInfo { character: '.', width: 3, height: 3, x_offset: 3, y_offset: 10, x_advance: 9, data_offset: 365, }, GlyphInfo { character: '/', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 370, }, GlyphInfo { character: '0', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 409, }, GlyphInfo { character: '1', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 463, }, GlyphInfo { character: '2', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 502, }, GlyphInfo { character: '3', width: 7, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 546, }, GlyphInfo { character: '4', width: 9, height: 11, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 588, }, GlyphInfo { character: '5', width: 7, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 638, }, GlyphInfo { character: '6', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 680, }, GlyphInfo { character: '7', width: 9, height: 11, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 734, }, GlyphInfo { character: '8', width: 7, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 784, }, GlyphInfo { character: '9', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 826, }, GlyphInfo { character: ':', width: 3, height: 10, x_offset: 3, y_offset: 3, x_advance: 9, data_offset: 880, }, GlyphInfo { character: ';', width: 3, height: 12, x_offset: 3, y_offset: 3, x_advance: 9, data_offset: 895, }, GlyphInfo { character: '<', width: 7, height: 9, x_offset: 1, y_offset: 2, x_advance: 9, data_offset: 913, }, GlyphInfo { character: '=', width: 7, height: 5, x_offset: 1, y_offset: 4, x_advance: 9, data_offset: 945, }, GlyphInfo { character: '>', width: 7, height: 9, x_offset: 1, y_offset: 2, x_advance: 9, data_offset: 963, }, GlyphInfo { character: '?', width: 7, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 995, }, GlyphInfo { character: '@', width: 9, height: 13, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1037, }, GlyphInfo { character: 'A', width: 9, height: 11, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1096, }, GlyphInfo { character: 'B', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1146, }, GlyphInfo { character: 'C', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1190, }, GlyphInfo { character: 'D', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1244, }, GlyphInfo { character: 'E', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1288, }, GlyphInfo { character: 'F', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1327, }, GlyphInfo { character: 'G', width: 8, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1366, }, GlyphInfo { character: 'H', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1414, }, GlyphInfo { character: 'I', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1453, }, GlyphInfo { character: 'J', width: 6, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1492, }, GlyphInfo { character: 'K', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1528, }, GlyphInfo { character: 'L', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1572, }, GlyphInfo { character: 'M', width: 9, height: 11, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1611, }, GlyphInfo { character: 'N', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1661, }, GlyphInfo { character: 'O', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1700, }, GlyphInfo { character: 'P', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1754, }, GlyphInfo { character: 'Q', width: 9, height: 14, x_offset: 0, y_offset: 1, x_advance: 9, data_offset: 1798, }, GlyphInfo { character: 'R', width: 8, height: 11, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1861, }, GlyphInfo { character: 'S', width: 7, height: 12, x_offset: 1, y_offset: 1, x_advance: 9, data_offset: 1905, }, GlyphInfo { character: 'T', width: 9, height: 11, x_offset: 0, y_offset: 1,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_24_bold.rs
frostsnap_fonts/src/noto_sans_24_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 24px //! Weight: 700 //! Characters: 95 //! Line height: 25px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_24_BOLD_DATA: &[u8] = &[ 0x35, 0x55, 0x3b, 0xff, 0xf9, 0xbf, 0xff, 0x8a, 0xff, 0xf7, 0x9f, 0xff, 0x69, 0xff, 0xf5, 0x8f, 0xff, 0x47, 0xff, 0xf3, 0x7f, 0xff, 0x26, 0xff, 0xe0, 0x5f, 0xfe, 0x04, 0xff, 0xd0, 0x29, 0x98, 0x00, 0x00, 0x00, 0x2a, 0xb8, 0x0a, 0xff, 0xf7, 0xcf, 0xff, 0x88, 0xef, 0xe4, 0x04, 0x73, 0x00, 0x35, 0x54, 0x03, 0x55, 0x50, 0xaf, 0xfd, 0x08, 0xff, 0xe0, 0x9f, 0xfd, 0x07, 0xff, 0xe0, 0x8f, 0xfc, 0x06, 0xff, 0xd0, 0x6f, 0xfb, 0x05, 0xff, 0xc0, 0x5f, 0xfa, 0x03, 0xff, 0xb0, 0x4f, 0xf9, 0x00, 0xef, 0xb0, 0x03, 0x31, 0x00, 0x33, 0x20, 0x00, 0x00, 0x02, 0x44, 0x10, 0x24, 0x40, 0x00, 0x00, 0x00, 0x9f, 0xf4, 0x0a, 0xfe, 0x10, 0x00, 0x00, 0x0b, 0xfe, 0x00, 0xcf, 0xc0, 0x00, 0x00, 0x00, 0xdf, 0xc0, 0x0e, 0xfb, 0x00, 0x00, 0x00, 0x2e, 0xfa, 0x04, 0xff, 0x80, 0x00, 0x68, 0x89, 0xff, 0xb8, 0xaf, 0xfa, 0x88, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x03, 0x44, 0xdf, 0xd4, 0x4e, 0xfb, 0x44, 0x40, 0x00, 0x1e, 0xfb, 0x04, 0xff, 0x90, 0x00, 0x35, 0x57, 0xff, 0xa5, 0x9f, 0xf8, 0x55, 0x29, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x54, 0x66, 0xdf, 0xd6, 0x6e, 0xfc, 0x66, 0x62, 0x00, 0x0e, 0xfb, 0x04, 0xff, 0x90, 0x00, 0x00, 0x04, 0xff, 0x90, 0x7f, 0xf7, 0x00, 0x00, 0x00, 0x7f, 0xf6, 0x0a, 0xff, 0x30, 0x00, 0x00, 0x09, 0xff, 0x30, 0xcf, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x06, 0x50, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x00, 0x00, 0x00, 0x04, 0x8e, 0xd8, 0x63, 0x00, 0x06, 0xcf, 0xff, 0xff, 0xfe, 0xc6, 0x6e, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xcf, 0xfe, 0xbe, 0xdb, 0xce, 0xc0, 0xef, 0xfb, 0x0e, 0xc0, 0x03, 0x50, 0xdf, 0xfd, 0x4e, 0xc0, 0x00, 0x00, 0xbf, 0xff, 0xee, 0xc0, 0x00, 0x00, 0x2d, 0xff, 0xff, 0xfc, 0x81, 0x00, 0x01, 0x9e, 0xff, 0xff, 0xfd, 0x60, 0x00, 0x02, 0x9e, 0xff, 0xff, 0xe5, 0x00, 0x00, 0x0e, 0xdc, 0xff, 0xfb, 0x00, 0x00, 0x0e, 0xc1, 0xdf, 0xfc, 0xda, 0x50, 0x0e, 0xc4, 0xef, 0xfc, 0xef, 0xfe, 0xde, 0xee, 0xff, 0xf8, 0xef, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x5a, 0xce, 0xef, 0xed, 0xb6, 0x00, 0x00, 0x00, 0x1e, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x70, 0x00, 0x00, 0x00, 0x05, 0x87, 0x20, 0x00, 0x00, 0x00, 0x45, 0x40, 0x00, 0x00, 0x2c, 0xff, 0xfe, 0x70, 0x00, 0x00, 0x6f, 0xfb, 0x00, 0x00, 0x0a, 0xff, 0xef, 0xfe, 0x40, 0x00, 0x0d, 0xfe, 0x40, 0x00, 0x01, 0xef, 0xe4, 0x9f, 0xfa, 0x00, 0x08, 0xff, 0xa0, 0x00, 0x00, 0x5f, 0xfc, 0x03, 0xff, 0xc0, 0x01, 0xdf, 0xe2, 0x00, 0x00, 0x07, 0xff, 0xb0, 0x0e, 0xfd, 0x00, 0x9f, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xfb, 0x00, 0xef, 0xd0, 0x3e, 0xfd, 0x10, 0x00, 0x00, 0x05, 0xff, 0xc0, 0x3f, 0xfc, 0x0a, 0xff, 0x71, 0x8a, 0x95, 0x00, 0x1e, 0xfe, 0x39, 0xff, 0xa4, 0xef, 0xc3, 0xdf, 0xff, 0xe9, 0x00, 0x9f, 0xfe, 0xff, 0xe4, 0xbf, 0xe5, 0xbf, 0xfe, 0xef, 0xe6, 0x01, 0xbf, 0xff, 0xe8, 0x6f, 0xfb, 0x1e, 0xfe, 0x27, 0xff, 0xb0, 0x00, 0x58, 0x73, 0x0c, 0xfe, 0x45, 0xff, 0xc0, 0x2e, 0xfd, 0x00, 0x00, 0x00, 0x08, 0xff, 0xa0, 0x6f, 0xfb, 0x00, 0xef, 0xe0, 0x00, 0x00, 0x01, 0xdf, 0xe2, 0x06, 0xff, 0xb0, 0x0e, 0xfe, 0x00, 0x00, 0x00, 0x9f, 0xf9, 0x00, 0x3f, 0xfc, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x3e, 0xfd, 0x10, 0x00, 0xdf, 0xe7, 0xaf, 0xfa, 0x00, 0x00, 0x0a, 0xff, 0x70, 0x00, 0x07, 0xff, 0xff, 0xfe, 0x30, 0x00, 0x04, 0xef, 0xc0, 0x00, 0x00, 0x09, 0xef, 0xfd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x54, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xce, 0xff, 0xfe, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x2d, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0xb9, 0xdf, 0xff, 0x40, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x5f, 0xff, 0x50, 0x00, 0x00, 0x00, 0x9f, 0xfd, 0x00, 0x7f, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x5f, 0xff, 0x97, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xef, 0xff, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x05, 0xef, 0xff, 0xfb, 0x20, 0x03, 0x55, 0x52, 0x00, 0x8e, 0xff, 0xff, 0xe7, 0x00, 0x0b, 0xff, 0xe3, 0x06, 0xef, 0xfe, 0xef, 0xfe, 0x70, 0x2e, 0xff, 0xc0, 0x0c, 0xff, 0xf8, 0x4d, 0xff, 0xe7, 0x9f, 0xff, 0x70, 0x0e, 0xff, 0xd0, 0x04, 0xdf, 0xfe, 0xef, 0xfd, 0x00, 0x1e, 0xff, 0xd0, 0x00, 0x4d, 0xff, 0xff, 0xe6, 0x00, 0x0d, 0xff, 0xf9, 0x10, 0x08, 0xef, 0xff, 0xc0, 0x00, 0x0a, 0xff, 0xff, 0xed, 0xef, 0xff, 0xff, 0xf9, 0x00, 0x02, 0xcf, 0xff, 0xff, 0xff, 0xfe, 0xef, 0xff, 0x90, 0x00, 0x19, 0xdf, 0xff, 0xfe, 0xb4, 0x4d, 0xff, 0xfa, 0x00, 0x00, 0x03, 0x56, 0x40, 0x00, 0x00, 0x00, 0x00, 0x35, 0x54, 0xaf, 0xfd, 0x9f, 0xfd, 0x8f, 0xfc, 0x6f, 0xfb, 0x5f, 0xfa, 0x4f, 0xf9, 0x03, 0x31, 0x00, 0x00, 0x35, 0x52, 0x00, 0x03, 0xef, 0xe3, 0x00, 0x0c, 0xff, 0x90, 0x00, 0x6f, 0xfd, 0x10, 0x00, 0xcf, 0xf9, 0x00, 0x04, 0xef, 0xe3, 0x00, 0x08, 0xff, 0xc0, 0x00, 0x0b, 0xff, 0xa0, 0x00, 0x0d, 0xff, 0x70, 0x00, 0x0e, 0xff, 0x60, 0x00, 0x0e, 0xff, 0x50, 0x00, 0x2f, 0xff, 0x30, 0x00, 0x0e, 0xff, 0x40, 0x00, 0x0e, 0xff, 0x60, 0x00, 0x0d, 0xff, 0x80, 0x00, 0x0b, 0xff, 0xa0, 0x00, 0x08, 0xff, 0xd0, 0x00, 0x02, 0xef, 0xf5, 0x00, 0x00, 0xbf, 0xfa, 0x00, 0x00, 0x4e, 0xfe, 0x30, 0x00, 0x09, 0xff, 0xa0, 0x00, 0x01, 0xbd, 0xd4, 0x25, 0x54, 0x00, 0x00, 0x2d, 0xfe, 0x50, 0x00, 0x06, 0xff, 0xd1, 0x00, 0x00, 0xcf, 0xf8, 0x00, 0x00, 0x7f, 0xfd, 0x00, 0x00, 0x1e, 0xff, 0x60, 0x00, 0x0b, 0xff, 0xa0, 0x00, 0x08, 0xff, 0xc0, 0x00, 0x06, 0xff, 0xe0, 0x00, 0x02, 0xff, 0xf3, 0x00, 0x00, 0xef, 0xf4, 0x00, 0x00, 0xef, 0xf5, 0x00, 0x00, 0xef, 0xf4, 0x00, 0x03, 0xff, 0xf2, 0x00, 0x06, 0xff, 0xe0, 0x00, 0x09, 0xff, 0xc0, 0x00, 0x0c, 0xff, 0x90, 0x00, 0x3e, 0xfe, 0x50, 0x00, 0x9f, 0xfc, 0x00, 0x01, 0xdf, 0xf6, 0x00, 0x09, 0xff, 0xb0, 0x00, 0x2c, 0xdc, 0x20, 0x00, 0x00, 0x00, 0x16, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xfd, 0x00, 0x00, 0x00, 0x20, 0x00, 0xcf, 0xc0, 0x00, 0x20, 0x0e, 0xc9, 0x5b, 0xfb, 0x59, 0xce, 0x14, 0xff, 0xff, 0xef, 0xef, 0xff, 0xf4, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xee, 0x60, 0x00, 0x1c, 0xff, 0xfc, 0x20, 0x00, 0x00, 0x08, 0xff, 0xdf, 0xf8, 0x00, 0x00, 0x05, 0xef, 0xe3, 0xef, 0xe5, 0x00, 0x00, 0xbf, 0xfa, 0x09, 0xff, 0xb0, 0x00, 0x00, 0x7d, 0x40, 0x2d, 0x80, 0x00, 0x00, 0x00, 0x47, 0x72, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0xcc, 0xcc, 0xdf, 0xfd, 0xcc, 0xca, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xdd, 0xdd, 0xef, 0xfd, 0xdd, 0xda, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x58, 0x82, 0x00, 0x00, 0x04, 0xdd, 0xd6, 0x07, 0xff, 0xe3, 0x0a, 0xff, 0xc0, 0x0c, 0xff, 0x80, 0x0e, 0xfe, 0x20, 0x4f, 0xfa, 0x00, 0x14, 0x42, 0x00, 0x7e, 0xee, 0xee, 0xe7, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xe1, 0x22, 0x22, 0x22, 0x2a, 0xb8, 0x0a, 0xff, 0xf7, 0xcf, 0xff, 0x88, 0xef, 0xe4, 0x04, 0x73, 0x00, 0x00, 0x00, 0x00, 0x57, 0x76, 0x00, 0x00, 0x00, 0xcf, 0xfa, 0x00, 0x00, 0x04, 0xef, 0xf5, 0x00, 0x00, 0x09, 0xff, 0xd0, 0x00, 0x00, 0x0d, 0xff, 0x90, 0x00, 0x00, 0x6f, 0xfe, 0x30, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x01, 0xef, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xe2, 0x00, 0x00, 0x0c, 0xff, 0xb0, 0x00, 0x00, 0x3e, 0xff, 0x60, 0x00, 0x00, 0x9f, 0xfd, 0x00, 0x00, 0x00, 0xcf, 0xfa, 0x00, 0x00, 0x04, 0xff, 0xf5, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x0d, 0xff, 0x90, 0x00, 0x00, 0x6f, 0xfe, 0x30, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x88, 0x50, 0x00, 0x00, 0x00, 0x9e, 0xff, 0xff, 0xd5, 0x00, 0x00, 0x9f, 0xff, 0xff, 0xff, 0xd4, 0x00, 0x3e, 0xff, 0xeb, 0xcf, 0xff, 0xb0, 0x09, 0xff, 0xf6, 0x00, 0xbf, 0xfe, 0x40, 0xcf, 0xfd, 0x00, 0x05, 0xff, 0xf8, 0x0e, 0xff, 0xb0, 0x00, 0x0e, 0xff, 0xb2, 0xff, 0xfa, 0x00, 0x00, 0xdf, 0xfc, 0x3f, 0xff, 0xa0, 0x00, 0x0d, 0xff, 0xd4, 0xff, 0xf9, 0x00, 0x00, 0xdf, 0xfd, 0x3f, 0xff, 0xa0, 0x00, 0x0d, 0xff, 0xd1, 0xff, 0xfa, 0x00, 0x00, 0xdf, 0xfc, 0x0d, 0xff, 0xb0, 0x00, 0x1e, 0xff, 0xb0, 0xbf, 0xfd, 0x00, 0x06, 0xff, 0xf9, 0x08, 0xff, 0xf8, 0x01, 0xcf, 0xfe, 0x40, 0x1d, 0xff, 0xec, 0xdf, 0xff, 0xb0, 0x00, 0x6e, 0xff, 0xff, 0xff, 0xe4, 0x00, 0x00, 0x6d, 0xff, 0xfe, 0xb4, 0x00, 0x00, 0x00, 0x03, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x55, 0x40, 0x00, 0x04, 0xcf, 0xfe, 0x00, 0x06, 0xef, 0xff, 0xe0, 0x09, 0xef, 0xff, 0xfe, 0x2b, 0xff, 0xfe, 0xff, 0xe7, 0xff, 0xfa, 0xbf, 0xfe, 0x0b, 0xe8, 0x0c, 0xff, 0xe0, 0x15, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0xcf, 0xfe, 0x00, 0x00, 0x26, 0x88, 0x61, 0x00, 0x00, 0x05, 0xbe, 0xff, 0xff, 0xe8, 0x00, 0x08, 0xef, 0xff, 0xff, 0xff, 0xf9, 0x01, 0xcf, 0xff, 0xdc, 0xdf, 0xff, 0xe3, 0x03, 0xdd, 0x70, 0x00, 0xaf, 0xff, 0x80, 0x04, 0x30, 0x00, 0x05, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x06, 0xef, 0xfd, 0x20, 0x00, 0x00, 0x06, 0xef, 0xfd, 0x30, 0x00, 0x00, 0x05, 0xef, 0xfd, 0x40, 0x00, 0x00, 0x05, 0xef, 0xfd, 0x30, 0x00, 0x00, 0x05, 0xef, 0xfd, 0x30, 0x00, 0x00, 0x05, 0xef, 0xfd, 0x32, 0x22, 0x22, 0x21, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x57, 0x87, 0x50, 0x00, 0x00, 0x4a, 0xef, 0xff, 0xff, 0xe9, 0x00, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x7e, 0xfd, 0xbb, 0xcf, 0xff, 0xe3, 0x00, 0xa7, 0x00, 0x00, 0xbf, 0xff, 0x60, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x36, 0x68, 0xbe, 0xfe, 0x60, 0x00, 0x09, 0xff, 0xff, 0xeb, 0x50, 0x00, 0x00, 0x9f, 0xff, 0xfe, 0xc9, 0x10, 0x00, 0x07, 0xbb, 0xce, 0xff, 0xfd, 0x20, 0x00, 0x00, 0x00, 0x1a, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x05, 0xff, 0xfc, 0x3a, 0x50, 0x00, 0x02, 0xcf, 0xff, 0xa4, 0xff, 0xdc, 0xbc, 0xef, 0xff, 0xe4, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x02, 0xad, 0xef, 0xff, 0xfe, 0xb5, 0x00, 0x00, 0x02, 0x46, 0x54, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x55, 0x52, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x02, 0xdf, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x6e, 0xfc, 0xff, 0xf6, 0x00, 0x00, 0x02, 0xdf, 0xe7, 0xff, 0xf6, 0x00, 0x00, 0x0b, 0xff, 0x87, 0xff, 0xf6, 0x00, 0x00, 0x7f, 0xfc, 0x07, 0xff, 0xf6, 0x00, 0x03, 0xef, 0xe3, 0x07, 0xff, 0xf6, 0x00, 0x0b, 0xff, 0x80, 0x07, 0xff, 0xf6, 0x00, 0x7f, 0xfd, 0x88, 0x8a, 0xff, 0xfa, 0x84, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x79, 0x99, 0x99, 0x9b, 0xff, 0xfb, 0x95, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf6, 0x00, 0x04, 0x55, 0x55, 0x55, 0x55, 0x30, 0x0e, 0xff, 0xff, 0xff, 0xff, 0x90, 0x0e, 0xff, 0xff, 0xff, 0xff, 0x90, 0x2f, 0xff, 0xee, 0xee, 0xee, 0x90, 0x4f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x5f, 0xff, 0x50, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x30, 0x00, 0x00, 0x00, 0x8f, 0xff, 0xde, 0xed, 0xa3, 0x00, 0x9f, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x05, 0x73, 0x13, 0x8e, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x07, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x03, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x05, 0xff, 0xfa, 0xa7, 0x10, 0x00, 0x3c, 0xff, 0xf6, 0xdf, 0xed, 0xcd, 0xef, 0xff, 0xd0, 0xdf, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x8d, 0xef, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x14, 0x65, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x77, 0x75, 0x00, 0x00, 0x04, 0xbe, 0xff, 0xff, 0xc0, 0x00, 0x08, 0xef, 0xff, 0xff, 0xfc, 0x00, 0x06, 0xef, 0xfe, 0xcb, 0xaa, 0xa0, 0x01, 0xdf, 0xfd, 0x50, 0x00, 0x00, 0x00, 0x8f, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xb0, 0x04, 0x30, 0x00, 0x00, 0xdf, 0xf8, 0x8e, 0xff, 0xea, 0x10, 0x0e, 0xff, 0xbf, 0xff, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xec, 0xce, 0xff, 0xf8, 0x4f, 0xff, 0xe6, 0x00, 0x5e, 0xff, 0xc4, 0xff, 0xfa, 0x00, 0x00, 0xcf, 0xfd, 0x2e, 0xff, 0xa0, 0x00, 0x0b, 0xff, 0xe0, 0xdf, 0xfc, 0x00, 0x00, 0xcf, 0xfd, 0x0a, 0xff, 0xf8, 0x00, 0x6e, 0xff, 0xb0, 0x3e, 0xff, 0xec, 0xce, 0xff, 0xe5, 0x00, 0x7e, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x00, 0x5c, 0xef, 0xff, 0xd7, 0x00, 0x00, 0x00, 0x02, 0x55, 0x30, 0x00, 0x00, 0x25, 0x55, 0x55, 0x55, 0x55, 0x55, 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xef, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe1, 0x00, 0x00, 0x00, 0x04, 0xef, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x01, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe4, 0x00, 0x00, 0x00, 0x04, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x87, 0x50, 0x00, 0x00, 0x02, 0xae, 0xff, 0xff, 0xe9, 0x00, 0x01, 0xdf, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x8f, 0xff, 0xc8, 0x8d, 0xff, 0xe4, 0x0b, 0xff, 0xe1, 0x00, 0x6f, 0xff, 0x70, 0xaf, 0xfd, 0x00, 0x05, 0xff, 0xf7, 0x06, 0xff, 0xfa, 0x02, 0xcf, 0xfe, 0x10, 0x0b, 0xff, 0xfd, 0xef, 0xfe, 0x70, 0x00, 0x1a, 0xff, 0xff, 0xfd, 0x50, 0x00, 0x02, 0xae, 0xff, 0xff, 0xd6, 0x00, 0x03, 0xdf, 0xff, 0xce, 0xff, 0xe9, 0x00, 0xbf, 0xfe, 0x70, 0x3c, 0xff, 0xf7, 0x2e, 0xff, 0x90, 0x00, 0x1d, 0xff, 0xc4, 0xff, 0xf6, 0x00, 0x00, 0xaf, 0xfd, 0x2f, 0xff, 0xa0, 0x00, 0x1d, 0xff, 0xc0, 0xcf, 0xff, 0xc9, 0xad, 0xff, 0xf8, 0x05, 0xef, 0xff, 0xff, 0xff, 0xfb, 0x10, 0x04, 0xbe, 0xff, 0xff, 0xd8, 0x00, 0x00, 0x00, 0x14, 0x65, 0x30, 0x00, 0x00, 0x00, 0x00, 0x26, 0x76, 0x20, 0x00, 0x00, 0x02, 0xae, 0xff, 0xfe, 0xb3, 0x00, 0x02, 0xdf, 0xff, 0xff, 0xff, 0xd4, 0x00, 0xaf, 0xff, 0xdb, 0xcf, 0xff, 0xc0, 0x1e, 0xff, 0xd2, 0x00, 0xbf, 0xff, 0x64, 0xff, 0xf9, 0x00, 0x03, 0xef, 0xfa, 0x6f, 0xff, 0x70, 0x00, 0x0d, 0xff, 0xc5, 0xff, 0xf9, 0x00, 0x00, 0xdf, 0xfd, 0x2e, 0xff, 0xd3, 0x01, 0xaf, 0xff, 0xd0, 0xbf, 0xff, 0xed, 0xef, 0xff, 0xfc, 0x03, 0xef, 0xff, 0xff, 0xeb, 0xff, 0xc0, 0x03, 0xbe, 0xfe, 0xc4, 0xcf, 0xfa, 0x00, 0x00, 0x01, 0x00, 0x1e, 0xff, 0x80, 0x00, 0x00, 0x00, 0x09, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x19, 0xef, 0xfa, 0x00, 0x1c, 0xbb, 0xce, 0xff, 0xfd, 0x20, 0x02, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x00, 0x2f, 0xff, 0xfe, 0xd8, 0x10, 0x00, 0x00, 0x46, 0x65, 0x20, 0x00, 0x00, 0x00, 0x05, 0x73, 0x08, 0xef, 0xe5, 0xcf, 0xff, 0x8a, 0xff, 0xf6, 0x29, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0xb8, 0x0a, 0xff, 0xf7, 0xcf, 0xff, 0x88, 0xef, 0xe4, 0x04, 0x73, 0x00, 0x00, 0x57, 0x40, 0x07, 0xef, 0xe5, 0x0b, 0xff, 0xf9, 0x09, 0xff, 0xf7, 0x01, 0x9b, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xdd, 0xd6, 0x07, 0xff, 0xe3, 0x0a, 0xff, 0xc0, 0x0c, 0xff, 0x80, 0x0e, 0xfe, 0x20, 0x4f, 0xfa, 0x00, 0x14, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9a, 0x00, 0x00, 0x00, 0x02, 0x9e, 0xfc, 0x00, 0x00, 0x02, 0x9e, 0xff, 0xfb, 0x00, 0x02, 0x9e, 0xff, 0xfd, 0x81, 0x02, 0x9e, 0xff, 0xfc, 0x70, 0x00, 0x9e, 0xff, 0xec, 0x60, 0x00, 0x00, 0xef, 0xfe, 0x70, 0x00, 0x00, 0x00, 0xce, 0xff, 0xec, 0x71, 0x00, 0x00, 0x05, 0xbe, 0xff, 0xfd, 0xa4, 0x00, 0x00, 0x03, 0x9e, 0xff, 0xfe, 0xb6, 0x00, 0x00, 0x01, 0x8d, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x6b, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0x99, 0x97, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x44, 0x44, 0x44, 0x44, 0x44, 0x43, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0xc7, 0x00, 0x00, 0x00, 0x3a, 0xef, 0xff, 0xc7, 0x00, 0x00, 0x00, 0x29, 0xdf, 0xff, 0xc7, 0x00, 0x00, 0x00, 0x18, 0xdf, 0xff, 0xc6, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfc, 0x00, 0x00, 0x39, 0xdf, 0xff, 0xe9, 0x00, 0x6b, 0xef, 0xff, 0xd9, 0x20, 0x8d, 0xff, 0xff, 0xc8, 0x10, 0x00, 0xef, 0xfe, 0xb6, 0x00, 0x00, 0x00, 0xee, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x78, 0x75, 0x00, 0x04, 0xae, 0xff, 0xff, 0xfd, 0x60, 0xcf, 0xff, 0xff, 0xff, 0xfe, 0x66, 0xff, 0xdb, 0xbc, 0xff, 0xfc, 0x09, 0x60, 0x00, 0x0c, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xaf, 0xfe, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xb0, 0x00, 0x00, 0x5d, 0xff, 0xe5, 0x00, 0x00, 0x7e, 0xff, 0xe7, 0x00, 0x00, 0x4e, 0xff, 0xd4, 0x00, 0x00, 0x09, 0xff, 0xd2, 0x00, 0x00, 0x00, 0xaf, 0xf8, 0x00, 0x00, 0x00, 0x06, 0x99, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xbb, 0x50, 0x00, 0x00, 0x01, 0xef, 0xfd, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xcf, 0xfb, 0x00, 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x65, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xbd, 0xff, 0xff, 0xed, 0x93, 0x00, 0x00, 0x00, 0x02, 0xbe, 0xff, 0xff, 0xef, 0xff, 0xfe, 0x70, 0x00, 0x00, 0x3d, 0xff, 0xd9, 0x52, 0x03, 0x6a, 0xef, 0xe8, 0x00, 0x01, 0xcf, 0xfa, 0x10, 0x00, 0x00, 0x00, 0x5d, 0xfe, 0x40, 0x09, 0xff, 0xa0, 0x04, 0xac, 0xdc, 0xb9, 0x45, 0xef, 0xb0, 0x2e, 0xfd, 0x10, 0x8e, 0xff, 0xff, 0xff, 0x90, 0xbf, 0xe2, 0x7f, 0xf8, 0x06, 0xef, 0xea, 0x8b, 0xff, 0x80, 0x8f, 0xf6, 0xbf, 0xe3, 0x0c, 0xfe, 0x60, 0x08, 0xff, 0x80, 0x6f, 0xf8, 0xcf, 0xd0, 0x2e, 0xfc, 0x00, 0x09, 0xff, 0x70, 0x5f, 0xf9, 0xdf, 0xd0, 0x4f, 0xfb, 0x00, 0x0a, 0xff, 0x60, 0x7f, 0xf7, 0xdf, 0xd0, 0x4f, 0xfc, 0x00, 0x0c, 0xff, 0x60, 0x9f, 0xf4, 0xcf, 0xe0, 0x0e, 0xfe, 0x50, 0x6e, 0xff, 0x82, 0xdf, 0xc0, 0xbf, 0xf4, 0x09, 0xff, 0xee, 0xfe, 0xdf, 0xee, 0xfe, 0x60, 0x7f, 0xfa, 0x01, 0xae, 0xff, 0xe8, 0x4d, 0xff, 0xe8, 0x00, 0x1d, 0xfe, 0x50, 0x03, 0x77, 0x20, 0x01, 0x67, 0x20, 0x00, 0x06, 0xef, 0xe7, 0x00, 0x00, 0x00, 0x01, 0x63, 0x00, 0x00, 0x00, 0x8e, 0xff, 0xda, 0x98, 0x8a, 0xbe, 0xf5, 0x00, 0x00, 0x00, 0x06, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x17, 0xbd, 0xee, 0xed, 0xb8, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0xef, 0xfe, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xd5, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x02, 0xef, 0xfa, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x8f, 0xff, 0x60, 0xbf, 0xfe, 0x10, 0x00, 0x00, 0x0c, 0xff, 0xe1, 0x07, 0xff, 0xf7, 0x00, 0x00, 0x03, 0xef, 0xfb, 0x00, 0x1e, 0xff, 0xb0, 0x00, 0x00, 0x8f, 0xff, 0x84, 0x44, 0xcf, 0xfe, 0x10, 0x00, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x00, 0x03, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x9f, 0xff, 0xee, 0xee, 0xee, 0xef, 0xfe, 0x20, 0x0d, 0xff, 0xe4, 0x00, 0x00, 0x0a, 0xff, 0xf8, 0x04, 0xff, 0xfd, 0x00, 0x00, 0x00, 0x5f, 0xff, 0xc0, 0x9f, 0xff, 0x90, 0x00, 0x00, 0x00, 0xdf, 0xfe, 0x3d, 0xff, 0xf4, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xf9, 0x45, 0x55, 0x54, 0x42, 0x00, 0x00, 0x0e, 0xff, 0xff, 0xff, 0xee, 0xb6, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x0e, 0xff, 0xec, 0xcd, 0xef, 0xff, 0xe2, 0xef, 0xfc, 0x00, 0x03, 0xdf, 0xff, 0x7e, 0xff, 0xc0, 0x00, 0x0a, 0xff, 0xf7, 0xef, 0xfc, 0x00, 0x00, 0xbf, 0xfe, 0x4e, 0xff, 0xd7, 0x78, 0xbf, 0xff, 0xb0, 0xef, 0xff, 0xff, 0xff, 0xfe, 0x91, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xeb, 0x40, 0xef, 0xfd, 0xaa, 0xac, 0xff, 0xfe, 0x3e, 0xff, 0xc0, 0x00, 0x09, 0xff, 0xfa, 0xef, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xce, 0xff, 0xc0, 0x00, 0x06, 0xff, 0xfc, 0xef, 0xfc, 0x00, 0x04, 0xcf, 0xff, 0xae, 0xff, 0xee, 0xee, 0xff, 0xff, 0xe4, 0xef, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x0e, 0xff, 0xff, 0xfe, 0xed, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x57, 0x88, 0x62, 0x00, 0x00, 0x01, 0x9d, 0xff, 0xff, 0xfe, 0xc6, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x02, 0xdf, 0xff, 0xfd, 0xcc, 0xef, 0xe2, 0x0a, 0xff, 0xfd, 0x60, 0x00, 0x17, 0x80, 0x2e, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfe, 0x81, 0x00, 0x27, 0xa0, 0x02, 0xef, 0xff, 0xfe, 0xdd, 0xef, 0xe0, 0x00, 0x4d, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x02, 0xad, 0xff, 0xff, 0xfd, 0xa0, 0x00, 0x00, 0x00, 0x36, 0x65, 0x30, 0x00, 0x45, 0x55, 0x54, 0x30, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xff, 0xff, 0xed, 0x94, 0x00, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x00, 0x0e, 0xff, 0xed, 0xde, 0xff, 0xff, 0xf8, 0x00, 0xef, 0xfc, 0x00, 0x05, 0xbf, 0xff, 0xe5, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0xbf, 0xff, 0xb0, 0xef, 0xfc, 0x00, 0x00, 0x03, 0xef, 0xfe, 0x1e, 0xff, 0xc0, 0x00, 0x00, 0x0c, 0xff, 0xf4, 0xef, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x6e, 0xff, 0xc0, 0x00, 0x00, 0x0b, 0xff, 0xf6, 0xef, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x5e, 0xff, 0xc0, 0x00, 0x00, 0x0d, 0xff, 0xe2, 0xef, 0xfc, 0x00, 0x00, 0x05, 0xff, 0xfd, 0x0e, 0xff, 0xc0, 0x00, 0x02, 0xdf, 0xff, 0x90, 0xef, 0xfc, 0x22, 0x58, 0xdf, 0xff, 0xd1, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x00, 0x0e, 0xff, 0xff, 0xee, 0xda, 0x60, 0x00, 0x00, 0x45, 0x55, 0x55, 0x55, 0x55, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x2d, 0xff, 0xed, 0xdd, 0xdd, 0xd1, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xd8, 0x88, 0x88, 0x60, 0xdf, 0xff, 0xff, 0xff, 0xfb, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xdf, 0xfe, 0xbb, 0xbb, 0xb8, 0x0d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x2d, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x45, 0x55, 0x55, 0x55, 0x54, 0xdf, 0xff, 0xff, 0xff, 0xfe, 0xdf, 0xff, 0xff, 0xff, 0xfe, 0xdf, 0xfe, 0xdd, 0xdd, 0xdd, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfe, 0xcc, 0xcc, 0xc9, 0xdf, 0xff, 0xff, 0xff, 0xfa, 0xdf, 0xff, 0xff, 0xff, 0xfa, 0xdf, 0xfd, 0x66, 0x66, 0x64, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x88, 0x75, 0x10, 0x00, 0x00, 0x07, 0xce, 0xff, 0xff, 0xfe, 0xb5, 0x00, 0x2b, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x40, 0x0b, 0xff, 0xff, 0xec, 0xbc, 0xef, 0xc0, 0x08, 0xff, 0xfe, 0x92, 0x00, 0x01, 0x75, 0x01, 0xdf, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x60, 0x06, 0xbb, 0xbb, 0xbb, 0x7b, 0xff, 0xf5, 0x00, 0x8f, 0xff, 0xff, 0xf9, 0xaf, 0xff, 0x60, 0x08, 0xff, 0xff, 0xff, 0x99, 0xff, 0xf8, 0x00, 0x49, 0x99, 0xff, 0xf9, 0x6f, 0xff, 0xb0, 0x00, 0x00, 0x4f, 0xff, 0x91, 0xef, 0xfe, 0x50, 0x00, 0x04, 0xff, 0xf9, 0x0a, 0xff, 0xfe, 0x70, 0x00, 0x4f, 0xff, 0x90, 0x2d, 0xff, 0xff, 0xed, 0xde, 0xff, 0xf9, 0x00, 0x4d, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00, 0x29, 0xdf, 0xff, 0xff, 0xec, 0xa5, 0x00, 0x00, 0x00, 0x25, 0x66, 0x41, 0x00, 0x00, 0x45, 0x54, 0x00, 0x00, 0x00, 0x35, 0x55, 0x2d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd9, 0x99, 0x99, 0x9b, 0xff, 0xf6, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xdf, 0xfe, 0xbb, 0xbb, 0xbb, 0xdf, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x6d, 0xff, 0xd0, 0x00, 0x00, 0x09, 0xff, 0xf6, 0x25, 0x55, 0x55, 0x55, 0x36, 0xff, 0xff, 0xff, 0xfa, 0x6f, 0xff, 0xff, 0xff, 0xa0, 0x7c, 0xff, 0xfd, 0x92, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0xa0, 0x01, 0x9d, 0xff, 0xfe, 0xa4, 0x6f, 0xff, 0xff, 0xff, 0xa6, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x45, 0x54, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x03, 0xef, 0xfb, 0x42, 0x4b, 0xff, 0xf9, 0xdf, 0xff, 0xff, 0xe3, 0xdf, 0xff, 0xfe, 0x80, 0xce, 0xfe, 0xc6, 0x00, 0x00, 0x10, 0x00, 0x00, 0x45, 0x54, 0x00, 0x00, 0x02, 0x55, 0x54, 0xdf, 0xfd, 0x00, 0x00, 0x0b, 0xff, 0xf8, 0xdf, 0xfd, 0x00, 0x00, 0x9f, 0xff, 0xb0, 0xdf, 0xfd, 0x00, 0x06, 0xef, 0xfd, 0x10, 0xdf, 0xfd, 0x00, 0x4e, 0xff, 0xe4, 0x00, 0xdf, 0xfd, 0x02, 0xdf, 0xfe, 0x60, 0x00, 0xdf, 0xfd, 0x0b, 0xff, 0xf9, 0x00, 0x00, 0xdf, 0xfd, 0x8f, 0xff, 0xb0, 0x00, 0x00, 0xdf, 0xfd, 0xef, 0xfe, 0x40, 0x00, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xa0, 0x00, 0x00, 0xdf, 0xff, 0xfe, 0xff, 0xe6, 0x00, 0x00, 0xdf, 0xfe, 0x86, 0xef, 0xfd, 0x10, 0x00, 0xdf, 0xfd, 0x00, 0xbf, 0xff, 0x90, 0x00, 0xdf, 0xfd, 0x00, 0x3e, 0xff, 0xe4, 0x00, 0xdf, 0xfd, 0x00, 0x08, 0xff, 0xfc, 0x00, 0xdf, 0xfd, 0x00, 0x00, 0xcf, 0xff, 0x80, 0xdf, 0xfd, 0x00, 0x00, 0x5e, 0xff, 0xe3, 0xdf, 0xfd, 0x00, 0x00, 0x0a, 0xff, 0xfb, 0x45, 0x54, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x22, 0x22, 0x22, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xef, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x45, 0x55, 0x51, 0x00, 0x00, 0x00, 0x03, 0x55, 0x55, 0x3d, 0xff, 0xff, 0x70, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xf9, 0xdf, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xff, 0x9d, 0xff, 0xff, 0xe1, 0x00, 0x00, 0x08, 0xff, 0xff, 0xf9, 0xdf, 0xfe, 0xff, 0x60, 0x00, 0x00, 0xbf, 0xfe, 0xff, 0x9d, 0xff, 0xbf, 0xfa, 0x00, 0x00, 0x2e, 0xfd, 0xdf, 0xf9, 0xdf, 0xf8, 0xff, 0xd0, 0x00, 0x07, 0xff, 0xad, 0xff, 0x9d, 0xff, 0x7d, 0xff, 0x50, 0x00, 0xbf, 0xf6, 0xdf, 0xf9, 0xdf, 0xf8, 0xaf, 0xf9, 0x00, 0x2e, 0xfd, 0x0e, 0xff, 0x9d, 0xff, 0x86, 0xff, 0xd0, 0x07, 0xff, 0xa0, 0xef, 0xf9, 0xdf, 0xf9, 0x0e, 0xfe, 0x30, 0xbf, 0xf6, 0x0e, 0xff, 0x9d, 0xff, 0x90, 0xbf, 0xf8, 0x1e, 0xfd, 0x00, 0xef, 0xf9, 0xdf, 0xf9, 0x07, 0xff, 0xc7, 0xff, 0xa0, 0x0e, 0xff, 0x9d, 0xff, 0x90, 0x1e, 0xfe, 0xbf, 0xf6, 0x00, 0xef, 0xf9, 0xdf, 0xf9, 0x00, 0xcf, 0xff, 0xfe, 0x00, 0x0e, 0xff, 0x9d, 0xff, 0x90, 0x08, 0xff, 0xff, 0xb0, 0x00, 0xef, 0xf9, 0xdf, 0xf9, 0x00, 0x3e, 0xff, 0xf6, 0x00, 0x0e, 0xff, 0x9d, 0xff, 0x90, 0x00, 0xcf, 0xfe, 0x10, 0x00, 0xef, 0xf9, 0x45, 0x55, 0x40, 0x00, 0x00, 0x00, 0x45, 0x52, 0xdf, 0xff, 0xe5, 0x00, 0x00, 0x00, 0xef, 0xf8, 0xdf, 0xff, 0xfc, 0x00, 0x00, 0x00, 0xef, 0xf8, 0xdf, 0xff, 0xff, 0x70, 0x00, 0x00, 0xef, 0xf8, 0xdf, 0xff, 0xff, 0xd1, 0x00, 0x00, 0xef, 0xf8, 0xdf, 0xfc, 0xff, 0xf9, 0x00, 0x00, 0xef, 0xf8, 0xdf, 0xf7, 0xdf, 0xfe, 0x30, 0x00, 0xef, 0xf8, 0xdf, 0xf7, 0x7f, 0xff, 0xb0, 0x00, 0xef, 0xf8, 0xdf, 0xf8, 0x0c, 0xff, 0xe5, 0x00, 0xef, 0xf8, 0xdf, 0xf8, 0x05, 0xef, 0xfc, 0x00, 0xef, 0xf8, 0xdf, 0xf9, 0x00, 0xbf, 0xff, 0x80, 0xdf, 0xf8, 0xdf, 0xf9, 0x00, 0x3e, 0xff, 0xd2, 0xdf, 0xf8, 0xdf, 0xf9, 0x00, 0x09, 0xff, 0xfa, 0xdf, 0xf8, 0xdf, 0xf9, 0x00, 0x01, 0xdf, 0xfe, 0xdf, 0xf8, 0xdf, 0xf9, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0xdf, 0xf9, 0x00, 0x00, 0x0c, 0xff, 0xff, 0xf8, 0xdf, 0xf9, 0x00, 0x00, 0x05, 0xef, 0xff, 0xf8, 0xdf, 0xf9, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xf8, 0x00, 0x00, 0x02, 0x68, 0x88, 0x62, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xef, 0xff, 0xff, 0xeb, 0x30, 0x00, 0x00, 0x6e, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x50, 0x00, 0x3e, 0xff, 0xfe, 0xdc, 0xce, 0xff, 0xfe, 0x30, 0x0b, 0xff, 0xfd, 0x50, 0x00, 0x4d, 0xff, 0xfb, 0x03, 0xef, 0xfe, 0x40, 0x00, 0x00, 0x4e, 0xff, 0xe2, 0x8f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x7a, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x08, 0xff, 0xf9, 0xbf, 0xff, 0x60, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xac, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfb, 0xbf, 0xff, 0x60, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xba, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf9, 0x7f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x72, 0xef, 0xfe, 0x50, 0x00, 0x00, 0x6e, 0xff, 0xe2, 0x0a, 0xff, 0xfe, 0x70, 0x00, 0x7e, 0xff, 0xfa, 0x00, 0x2d, 0xff, 0xff, 0xed, 0xef, 0xff, 0xfd, 0x20, 0x00, 0x4d, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x30, 0x00, 0x00, 0x19, 0xde, 0xff, 0xfe, 0xd9, 0x10, 0x00, 0x00, 0x00, 0x00, 0x25, 0x65, 0x20, 0x00, 0x00, 0x00, 0x45, 0x55, 0x54, 0x30, 0x00, 0x00, 0xef, 0xff, 0xff, 0xfe, 0xc7, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0xa0, 0xef, 0xfe, 0xde, 0xef, 0xff, 0xf7, 0xef, 0xfc, 0x00, 0x3b, 0xff, 0xfb, 0xef, 0xfc, 0x00, 0x01, 0xef, 0xfd, 0xef, 0xfc, 0x00, 0x00, 0xdf, 0xfd, 0xef, 0xfc, 0x00, 0x04, 0xef, 0xfc, 0xef, 0xfc, 0x44, 0x7d, 0xff, 0xf9, 0xef, 0xff, 0xff, 0xff, 0xff, 0xd2, 0xef, 0xff, 0xff, 0xff, 0xfd, 0x50, 0xef, 0xfe, 0xee, 0xdc, 0x81, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x68, 0x88, 0x62, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xef, 0xff, 0xff, 0xeb, 0x30, 0x00, 0x00, 0x6e, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x50, 0x00, 0x3e, 0xff, 0xfe, 0xdc, 0xce, 0xff, 0xfe, 0x30, 0x0b, 0xff, 0xfd, 0x50, 0x00, 0x4d, 0xff, 0xfb, 0x03, 0xef, 0xfe, 0x40, 0x00, 0x00, 0x4e, 0xff, 0xe2, 0x8f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x7a, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x08, 0xff, 0xf9, 0xbf, 0xff, 0x60, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xac, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfb, 0xbf, 0xff, 0x60, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xba, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf9, 0x7f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x72, 0xef, 0xfe, 0x50, 0x00, 0x00, 0x6e, 0xff, 0xe2, 0x0a, 0xff, 0xfe, 0x70, 0x00, 0x7e, 0xff, 0xfa, 0x00, 0x2d, 0xff, 0xff, 0xed, 0xef, 0xff, 0xfd, 0x20, 0x00, 0x4d, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x00, 0x00, 0x19, 0xde, 0xff, 0xff, 0xfc, 0x10, 0x00, 0x00, 0x00, 0x00, 0x25, 0x6d, 0xff, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x33, 0x20, 0x45, 0x55, 0x54, 0x20, 0x00, 0x00, 0x00, 0xef, 0xff,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_18_light.rs
frostsnap_fonts/src/noto_sans_18_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 18px //! Weight: 300 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_18_LIGHT_DATA: &[u8] = &[ 0x8c, 0x8d, 0x8c, 0x7c, 0x7c, 0x6c, 0x6c, 0x6b, 0x5b, 0x48, 0x00, 0x59, 0xae, 0x13, 0xb7, 0x0c, 0x6c, 0x70, 0xc6, 0xb6, 0x0c, 0x6b, 0x60, 0xb5, 0x94, 0x09, 0x30, 0x00, 0x00, 0x88, 0x00, 0x97, 0x00, 0x00, 0x00, 0xb6, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xd2, 0x00, 0xd1, 0x00, 0x00, 0x02, 0xd0, 0x03, 0xd0, 0x00, 0x0c, 0xdd, 0xed, 0xdd, 0xed, 0xd4, 0x00, 0x08, 0x90, 0x09, 0x90, 0x00, 0x00, 0x0b, 0x70, 0x0b, 0x60, 0x00, 0x00, 0x0d, 0x30, 0x0d, 0x20, 0x00, 0x8c, 0xce, 0xcc, 0xce, 0xcc, 0x80, 0x23, 0x6c, 0x33, 0x7b, 0x33, 0x20, 0x00, 0x8a, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa7, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc4, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x07, 0x60, 0x00, 0x00, 0x5b, 0xb6, 0x20, 0x3d, 0xdd, 0xcc, 0xe6, 0xba, 0x09, 0x80, 0x21, 0xd5, 0x09, 0x80, 0x00, 0xc9, 0x09, 0x80, 0x00, 0x5e, 0xbb, 0x80, 0x00, 0x03, 0x9d, 0xd9, 0x20, 0x00, 0x09, 0xab, 0xd5, 0x00, 0x09, 0x80, 0x9c, 0x00, 0x09, 0x80, 0x6d, 0x10, 0x09, 0x80, 0xab, 0xdc, 0xac, 0xcc, 0xc3, 0x27, 0x8c, 0xb5, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xcd, 0xd4, 0x00, 0x00, 0xc4, 0x00, 0x0b, 0x90, 0x7b, 0x00, 0x08, 0xb0, 0x00, 0x0d, 0x20, 0x1e, 0x00, 0x2d, 0x30, 0x00, 0x0e, 0x00, 0x0d, 0x30, 0x9a, 0x00, 0x00, 0x0e, 0x00, 0x0d, 0x23, 0xd2, 0x00, 0x00, 0x0d, 0x20, 0x1e, 0x0a, 0x87, 0xdd, 0x80, 0x0a, 0x80, 0x8b, 0x4d, 0x2d, 0x43, 0xd4, 0x03, 0xcd, 0xd4, 0xc7, 0x7b, 0x00, 0x99, 0x00, 0x01, 0x06, 0xc0, 0x99, 0x00, 0x7b, 0x00, 0x00, 0x0c, 0x50, 0x99, 0x00, 0x7b, 0x00, 0x00, 0x8b, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0x01, 0xd4, 0x00, 0x4d, 0x10, 0xc6, 0x00, 0x09, 0xa0, 0x00, 0x0a, 0xdc, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xae, 0xdd, 0x80, 0x00, 0x00, 0x08, 0xd3, 0x04, 0xe5, 0x00, 0x00, 0x0b, 0x80, 0x00, 0xb9, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0xd7, 0x00, 0x00, 0x04, 0xe5, 0x2b, 0xc0, 0x00, 0x00, 0x00, 0x7e, 0xda, 0x10, 0x00, 0x00, 0x05, 0xdc, 0xe5, 0x00, 0x01, 0x50, 0x6e, 0x70, 0x8e, 0x50, 0x07, 0xd0, 0xc8, 0x00, 0x08, 0xe5, 0x0b, 0x90, 0xe5, 0x00, 0x00, 0x7e, 0x8d, 0x20, 0xd7, 0x00, 0x00, 0x09, 0xf8, 0x00, 0x9d, 0x40, 0x01, 0x8e, 0xae, 0x50, 0x0a, 0xed, 0xde, 0xb5, 0x07, 0xe5, 0x00, 0x15, 0x41, 0x00, 0x00, 0x00, 0xb7, 0xc7, 0xb6, 0xb6, 0x94, 0x00, 0x1c, 0x40, 0x0a, 0xa0, 0x04, 0xe2, 0x00, 0xab, 0x00, 0x0d, 0x70, 0x02, 0xe2, 0x00, 0x5e, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x05, 0xd0, 0x00, 0x2e, 0x10, 0x00, 0xd6, 0x00, 0x0a, 0xa0, 0x00, 0x4e, 0x20, 0x00, 0xaa, 0x00, 0x01, 0xc4, 0x4c, 0x20, 0x00, 0xab, 0x00, 0x02, 0xe4, 0x00, 0x0a, 0xa0, 0x00, 0x7d, 0x00, 0x02, 0xe2, 0x00, 0x0d, 0x50, 0x00, 0xd6, 0x00, 0x0d, 0x60, 0x00, 0xd5, 0x00, 0x2e, 0x20, 0x07, 0xd0, 0x00, 0xaa, 0x00, 0x2e, 0x40, 0x0a, 0xb0, 0x04, 0xc2, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x02, 0x00, 0xa8, 0x00, 0x31, 0xec, 0x9a, 0x99, 0xdd, 0x01, 0x58, 0xed, 0x85, 0x10, 0x00, 0x8a, 0xc6, 0x00, 0x00, 0x5e, 0x35, 0xe3, 0x00, 0x09, 0x90, 0x0a, 0x80, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x2d, 0xdd, 0xde, 0xdd, 0xd6, 0x03, 0x33, 0x8b, 0x33, 0x31, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x02, 0x30, 0x9c, 0x0b, 0xa0, 0xd5, 0x3d, 0x03, 0x50, 0x37, 0x77, 0x71, 0x5b, 0xbb, 0xb2, 0x59, 0xae, 0x13, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x02, 0xe3, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x0c, 0x70, 0x00, 0x04, 0xe1, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x0d, 0x50, 0x00, 0x06, 0xd0, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x4b, 0xee, 0xd6, 0x00, 0x2d, 0x90, 0x06, 0xd5, 0x08, 0xc0, 0x00, 0x09, 0xb0, 0xc8, 0x00, 0x00, 0x3e, 0x0d, 0x50, 0x00, 0x00, 0xe4, 0xe3, 0x00, 0x00, 0x0d, 0x6e, 0x20, 0x00, 0x00, 0xd6, 0xe3, 0x00, 0x00, 0x0d, 0x6d, 0x50, 0x00, 0x00, 0xe4, 0xc7, 0x00, 0x00, 0x3e, 0x18, 0xb0, 0x00, 0x08, 0xc0, 0x2d, 0x70, 0x04, 0xd6, 0x00, 0x5d, 0xdd, 0xe8, 0x00, 0x00, 0x04, 0x51, 0x00, 0x00, 0x00, 0x07, 0xd3, 0x01, 0xac, 0xe3, 0x3d, 0xa1, 0xe3, 0x16, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9d, 0xee, 0xc5, 0x00, 0x0a, 0xb4, 0x00, 0x8e, 0x30, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x00, 0x4e, 0x30, 0x00, 0x00, 0x01, 0xc9, 0x00, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x00, 0xac, 0x10, 0x00, 0x00, 0x0a, 0xc1, 0x00, 0x00, 0x00, 0x9c, 0x20, 0x00, 0x00, 0x09, 0xc2, 0x00, 0x00, 0x00, 0x2e, 0xee, 0xee, 0xee, 0xe3, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0xad, 0xee, 0xc7, 0x00, 0x0c, 0x93, 0x00, 0x7e, 0x60, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x14, 0x47, 0xca, 0x00, 0x00, 0x5d, 0xde, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x80, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x03, 0xf2, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x37, 0x10, 0x00, 0x5d, 0x90, 0x3c, 0xed, 0xcd, 0xd8, 0x00, 0x00, 0x14, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x00, 0x6d, 0xd0, 0x00, 0x00, 0x00, 0x3d, 0x7d, 0x00, 0x00, 0x00, 0x0b, 0x85, 0xd0, 0x00, 0x00, 0x08, 0xb0, 0x5d, 0x00, 0x00, 0x05, 0xd2, 0x05, 0xd0, 0x00, 0x01, 0xd6, 0x00, 0x5d, 0x00, 0x00, 0xaa, 0x00, 0x05, 0xd0, 0x00, 0x7d, 0x55, 0x55, 0x7d, 0x55, 0x09, 0xdd, 0xdd, 0xdd, 0xed, 0xd1, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x0d, 0xdd, 0xdd, 0xd7, 0x01, 0xe4, 0x44, 0x44, 0x20, 0x3d, 0x00, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x08, 0xdb, 0xcc, 0xa5, 0x00, 0x38, 0x64, 0x69, 0xe7, 0x00, 0x00, 0x00, 0x07, 0xd1, 0x00, 0x00, 0x00, 0x1e, 0x40, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x5e, 0x17, 0x30, 0x00, 0x5d, 0x80, 0xae, 0xdc, 0xdd, 0x80, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x04, 0xbe, 0xdd, 0x80, 0x05, 0xd9, 0x20, 0x01, 0x01, 0xd7, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x0a, 0x90, 0x00, 0x00, 0x00, 0xc6, 0x9c, 0xdd, 0xa1, 0x0d, 0xc9, 0x20, 0x3c, 0xb0, 0xda, 0x00, 0x00, 0x2e, 0x4d, 0x60, 0x00, 0x00, 0xc7, 0xc8, 0x00, 0x00, 0x0c, 0x78, 0xc0, 0x00, 0x02, 0xe4, 0x1d, 0x90, 0x02, 0xbb, 0x00, 0x4c, 0xdc, 0xeb, 0x20, 0x00, 0x03, 0x52, 0x00, 0x00, 0x3d, 0xdd, 0xdd, 0xdd, 0xd6, 0x04, 0x44, 0x44, 0x45, 0xe3, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x1d, 0x50, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x03, 0xe4, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x1e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x6c, 0xdd, 0xd8, 0x00, 0x5e, 0x70, 0x04, 0xd8, 0x0a, 0xa0, 0x00, 0x07, 0xc0, 0xaa, 0x00, 0x00, 0x7c, 0x05, 0xd5, 0x00, 0x2d, 0x70, 0x06, 0xda, 0x9d, 0x80, 0x00, 0x2a, 0xdd, 0xb4, 0x00, 0x5d, 0x81, 0x07, 0xd7, 0x0c, 0x80, 0x00, 0x05, 0xe2, 0xe3, 0x00, 0x00, 0x0d, 0x5e, 0x50, 0x00, 0x01, 0xe4, 0xac, 0x30, 0x02, 0xbc, 0x01, 0xad, 0xcc, 0xdb, 0x20, 0x00, 0x14, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xee, 0xc4, 0x00, 0x06, 0xd6, 0x00, 0x8e, 0x40, 0x0c, 0x80, 0x00, 0x0a, 0xb0, 0x1e, 0x30, 0x00, 0x04, 0xe0, 0x2e, 0x10, 0x00, 0x00, 0xe4, 0x0e, 0x60, 0x00, 0x05, 0xe5, 0x09, 0xc3, 0x00, 0x5c, 0xe4, 0x01, 0xae, 0xdd, 0xc4, 0xe1, 0x00, 0x01, 0x42, 0x04, 0xd0, 0x00, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x2d, 0x50, 0x00, 0x00, 0x04, 0xca, 0x00, 0x06, 0xcc, 0xdd, 0x80, 0x00, 0x00, 0x45, 0x40, 0x00, 0x00, 0x7a, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xae, 0x13, 0x07, 0xa0, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0a, 0xb0, 0xc9, 0x0e, 0x45, 0xc0, 0x45, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x01, 0x8d, 0xb3, 0x00, 0x02, 0x9d, 0xa3, 0x00, 0x02, 0x9d, 0x92, 0x00, 0x00, 0x2e, 0xb2, 0x00, 0x00, 0x00, 0x05, 0xbd, 0x81, 0x00, 0x00, 0x00, 0x04, 0xad, 0x93, 0x00, 0x00, 0x00, 0x02, 0x9d, 0xb3, 0x00, 0x00, 0x00, 0x01, 0x86, 0xbb, 0xbb, 0xbb, 0xbb, 0x57, 0x77, 0x77, 0x77, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0xdd, 0xdd, 0xdd, 0x60, 0x2a, 0x30, 0x00, 0x00, 0x00, 0x19, 0xda, 0x30, 0x00, 0x00, 0x00, 0x18, 0xda, 0x40, 0x00, 0x00, 0x00, 0x18, 0xcb, 0x40, 0x00, 0x00, 0x00, 0x09, 0xe6, 0x00, 0x00, 0x06, 0xcc, 0x70, 0x00, 0x18, 0xdb, 0x60, 0x00, 0x19, 0xda, 0x40, 0x00, 0x00, 0x29, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xee, 0xea, 0x20, 0x57, 0x20, 0x3b, 0xb0, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x7d, 0x40, 0x00, 0x08, 0xd4, 0x00, 0x00, 0x4d, 0x30, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x06, 0xac, 0xcc, 0xa5, 0x00, 0x00, 0x00, 0x4c, 0xb7, 0x42, 0x48, 0xcb, 0x20, 0x00, 0x5d, 0x60, 0x00, 0x00, 0x00, 0xab, 0x00, 0x1d, 0x60, 0x00, 0x46, 0x51, 0x00, 0xc7, 0x08, 0xb0, 0x03, 0xcc, 0xbc, 0xe0, 0x06, 0xc0, 0xc6, 0x00, 0xc8, 0x00, 0x0e, 0x00, 0x1e, 0x0d, 0x10, 0x5d, 0x00, 0x02, 0xd0, 0x00, 0xd0, 0xe0, 0x08, 0xb0, 0x00, 0x4d, 0x00, 0x0d, 0x0e, 0x00, 0x7c, 0x00, 0x07, 0xd0, 0x04, 0xc0, 0xd2, 0x02, 0xd4, 0x02, 0xcd, 0x20, 0xb8, 0x0b, 0x80, 0x07, 0xdd, 0xd6, 0x7d, 0xda, 0x00, 0x6d, 0x10, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0xab, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x96, 0x56, 0x8b, 0x70, 0x00, 0x00, 0x00, 0x39, 0xbc, 0xba, 0x71, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x0a, 0xda, 0x00, 0x00, 0x00, 0x01, 0xd6, 0xe1, 0x00, 0x00, 0x00, 0x7c, 0x0c, 0x70, 0x00, 0x00, 0x0c, 0x80, 0x8c, 0x00, 0x00, 0x03, 0xe2, 0x02, 0xe3, 0x00, 0x00, 0x9b, 0x00, 0x0b, 0x90, 0x00, 0x0d, 0xa8, 0x88, 0xbd, 0x00, 0x06, 0xdb, 0xbb, 0xbb, 0xe6, 0x00, 0xb9, 0x00, 0x00, 0x0a, 0xb0, 0x3e, 0x30, 0x00, 0x00, 0x4e, 0x29, 0xb0, 0x00, 0x00, 0x00, 0xc8, 0xd7, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x5d, 0xdd, 0xdd, 0xb7, 0x00, 0x6d, 0x33, 0x34, 0x8e, 0x90, 0x6d, 0x00, 0x00, 0x07, 0xe0, 0x6d, 0x00, 0x00, 0x04, 0xe0, 0x6d, 0x00, 0x00, 0x08, 0xc0, 0x6d, 0x55, 0x56, 0x9c, 0x50, 0x6e, 0xcc, 0xcd, 0xd9, 0x20, 0x6d, 0x00, 0x00, 0x1a, 0xd1, 0x6d, 0x00, 0x00, 0x00, 0xd7, 0x6d, 0x00, 0x00, 0x00, 0xd8, 0x6d, 0x00, 0x00, 0x03, 0xe5, 0x6d, 0x00, 0x01, 0x5c, 0xc0, 0x6e, 0xee, 0xee, 0xd9, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x29, 0xde, 0xee, 0xc7, 0x04, 0xdc, 0x60, 0x02, 0x86, 0x0c, 0xa0, 0x00, 0x00, 0x00, 0x7d, 0x10, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x80, 0x00, 0x00, 0x00, 0x07, 0xe9, 0x20, 0x00, 0x33, 0x00, 0x5c, 0xed, 0xdd, 0xd5, 0x00, 0x00, 0x14, 0x53, 0x00, 0x5d, 0xdd, 0xdc, 0xb6, 0x00, 0x06, 0xd3, 0x34, 0x59, 0xdb, 0x20, 0x6d, 0x00, 0x00, 0x02, 0xcb, 0x06, 0xd0, 0x00, 0x00, 0x03, 0xe4, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x96, 0xd0, 0x00, 0x00, 0x00, 0xab, 0x6d, 0x00, 0x00, 0x00, 0x09, 0xb6, 0xd0, 0x00, 0x00, 0x00, 0xaa, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x96, 0xd0, 0x00, 0x00, 0x03, 0xe4, 0x6d, 0x00, 0x00, 0x01, 0xcb, 0x06, 0xd0, 0x00, 0x38, 0xdc, 0x20, 0x6e, 0xee, 0xed, 0xb7, 0x00, 0x00, 0x5d, 0xdd, 0xdd, 0xdc, 0x6d, 0x33, 0x33, 0x33, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x66, 0x66, 0x64, 0x6e, 0xcc, 0xcc, 0xc8, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0xee, 0xee, 0xed, 0x5d, 0xdd, 0xdd, 0xdc, 0x6d, 0x33, 0x33, 0x33, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0xbb, 0xbb, 0xb7, 0x6e, 0x77, 0x77, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0xee, 0xed, 0xb5, 0x02, 0xcd, 0x71, 0x00, 0x49, 0x40, 0xbb, 0x10, 0x00, 0x00, 0x00, 0x6e, 0x20, 0x00, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x1a, 0xaa, 0xa8, 0xd7, 0x00, 0x01, 0x99, 0x9b, 0xbc, 0x90, 0x00, 0x00, 0x00, 0x9b, 0x8c, 0x00, 0x00, 0x00, 0x09, 0xb2, 0xd8, 0x00, 0x00, 0x00, 0x9b, 0x06, 0xea, 0x30, 0x00, 0x1a, 0xb0, 0x04, 0xbe, 0xdc, 0xde, 0xc8, 0x00, 0x00, 0x14, 0x54, 0x10, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x0c, 0x56, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x00, 0x0d, 0x66, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x00, 0x0d, 0x66, 0xd6, 0x66, 0x66, 0x66, 0xd6, 0x6e, 0xcc, 0xcc, 0xcc, 0xce, 0x66, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x00, 0x0d, 0x66, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x00, 0x0d, 0x66, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x3c, 0xdd, 0xa0, 0x0c, 0x80, 0x00, 0xc8, 0x00, 0x0c, 0x80, 0x00, 0xc8, 0x00, 0x0c, 0x80, 0x00, 0xc8, 0x00, 0x0c, 0x80, 0x00, 0xc8, 0x00, 0x0c, 0x80, 0x00, 0xc8, 0x00, 0x0c, 0x80, 0x3c, 0xed, 0x90, 0x00, 0x05, 0xc0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x6d, 0x00, 0x06, 0xd0, 0x00, 0x7c, 0x00, 0x0b, 0xa9, 0xcd, 0xd3, 0x37, 0x50, 0x00, 0x5c, 0x00, 0x00, 0x06, 0xc4, 0x6d, 0x00, 0x00, 0x6d, 0x60, 0x6d, 0x00, 0x05, 0xd6, 0x00, 0x6d, 0x00, 0x4d, 0x70, 0x00, 0x6d, 0x04, 0xd7, 0x00, 0x00, 0x6d, 0x3d, 0x90, 0x00, 0x00, 0x6e, 0xdb, 0xd2, 0x00, 0x00, 0x6e, 0x70, 0xcb, 0x00, 0x00, 0x6d, 0x00, 0x3e, 0x70, 0x00, 0x6d, 0x00, 0x06, 0xe4, 0x00, 0x6d, 0x00, 0x00, 0xac, 0x10, 0x6d, 0x00, 0x00, 0x1c, 0xa0, 0x6d, 0x00, 0x00, 0x04, 0xe6, 0x5c, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0xee, 0xee, 0xed, 0x5d, 0x90, 0x00, 0x00, 0x00, 0x0c, 0xc6, 0xde, 0x10, 0x00, 0x00, 0x06, 0xde, 0x6c, 0xc7, 0x00, 0x00, 0x00, 0xba, 0xe6, 0xd8, 0xc0, 0x00, 0x00, 0x2e, 0x5e, 0x6d, 0x2e, 0x40, 0x00, 0x08, 0xb5, 0xe6, 0xd0, 0xa9, 0x00, 0x00, 0xd5, 0x5e, 0x6d, 0x05, 0xd0, 0x00, 0x5d, 0x05, 0xe6, 0xd0, 0x0d, 0x70, 0x0b, 0x90, 0x5e, 0x6d, 0x00, 0x8b, 0x02, 0xe2, 0x05, 0xe6, 0xd0, 0x02, 0xe3, 0x8b, 0x00, 0x5e, 0x6d, 0x00, 0x0b, 0x9d, 0x60, 0x05, 0xe6, 0xd0, 0x00, 0x6e, 0xd0, 0x00, 0x5e, 0x6d, 0x00, 0x00, 0xd9, 0x00, 0x05, 0xe0, 0x5d, 0x50, 0x00, 0x00, 0x0b, 0x76, 0xed, 0x10, 0x00, 0x00, 0xc7, 0x6c, 0xca, 0x00, 0x00, 0x0c, 0x76, 0xc5, 0xe5, 0x00, 0x00, 0xc7, 0x6d, 0x09, 0xd1, 0x00, 0x0c, 0x76, 0xd0, 0x1c, 0x90, 0x00, 0xc7, 0x6d, 0x00, 0x5e, 0x50, 0x0c, 0x76, 0xd0, 0x00, 0x9d, 0x10, 0xc7, 0x6d, 0x00, 0x01, 0xd9, 0x0c, 0x76, 0xd0, 0x00, 0x05, 0xe5, 0xb7, 0x6d, 0x00, 0x00, 0x09, 0xdb, 0x76, 0xd0, 0x00, 0x00, 0x1d, 0xe7, 0x6d, 0x00, 0x00, 0x00, 0x5e, 0x70, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x4a, 0xde, 0xed, 0xa2, 0x00, 0x05, 0xea, 0x40, 0x04, 0xbd, 0x40, 0x1d, 0x80, 0x00, 0x00, 0x0a, 0xc0, 0x8d, 0x00, 0x00, 0x00, 0x02, 0xe5, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xb9, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x9b, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x9b, 0xd7, 0x00, 0x00, 0x00, 0x00, 0xab, 0xc9, 0x00, 0x00, 0x00, 0x00, 0xba, 0x9c, 0x00, 0x00, 0x00, 0x01, 0xe6, 0x3e, 0x70, 0x00, 0x00, 0x09, 0xc0, 0x07, 0xe8, 0x10, 0x02, 0xae, 0x50, 0x00, 0x6c, 0xed, 0xde, 0xb4, 0x00, 0x00, 0x00, 0x25, 0x41, 0x00, 0x00, 0x5d, 0xdd, 0xdc, 0x92, 0x06, 0xd3, 0x34, 0x6c, 0xd2, 0x6d, 0x00, 0x00, 0x1d, 0x96, 0xd0, 0x00, 0x00, 0xab, 0x6d, 0x00, 0x00, 0x0a, 0xa6, 0xd0, 0x00, 0x02, 0xd7, 0x6d, 0x55, 0x68, 0xdb, 0x06, 0xec, 0xcc, 0xa6, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x4a, 0xde, 0xed, 0xa2, 0x00, 0x05, 0xea, 0x40, 0x04, 0xbd, 0x40, 0x1d, 0x80, 0x00, 0x00, 0x0a, 0xc0, 0x8d, 0x00, 0x00, 0x00, 0x02, 0xe5, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xb9, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x9b, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x9b, 0xd7, 0x00, 0x00, 0x00, 0x00, 0xab, 0xc9, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x9c, 0x00, 0x00, 0x00, 0x01, 0xe6, 0x3e, 0x70, 0x00, 0x00, 0x09, 0xc0, 0x07, 0xe8, 0x10, 0x02, 0xae, 0x40, 0x00, 0x6c, 0xed, 0xde, 0xb4, 0x00, 0x00, 0x00, 0x25, 0x8e, 0x50, 0x00, 0x00, 0x00, 0x00, 0x09, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x30, 0x00, 0x00, 0x00, 0x00, 0x03, 0x10, 0x5d, 0xdd, 0xdc, 0xa3, 0x00, 0x6d, 0x33, 0x46, 0xbd, 0x30, 0x6d, 0x00, 0x00, 0x0c, 0x90, 0x6d, 0x00, 0x00, 0x0a, 0xb0, 0x6d, 0x00, 0x00, 0x0b, 0xa0, 0x6d, 0x00, 0x00, 0x5e, 0x50, 0x6e, 0x99, 0x9b, 0xd7, 0x00, 0x6e, 0x99, 0x9e, 0x50, 0x00, 0x6d, 0x00, 0x0a, 0xc0, 0x00, 0x6d, 0x00, 0x02, 0xd7, 0x00, 0x6d, 0x00, 0x00, 0x7d, 0x20, 0x6d, 0x00, 0x00, 0x0c, 0xa0, 0x6d, 0x00, 0x00, 0x04, 0xe5, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0xce, 0xee, 0xc6, 0x08, 0xd6, 0x10, 0x38, 0x50, 0xd7, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x04, 0xdc, 0x60, 0x00, 0x00, 0x02, 0x9d, 0xd9, 0x20, 0x00, 0x00, 0x06, 0xbd, 0x40, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x00, 0x00, 0x00, 0x7d, 0x17, 0x10, 0x00, 0x5d, 0x81, 0xde, 0xdc, 0xdd, 0x80, 0x00, 0x24, 0x53, 0x00, 0x00, 0xcd, 0xdd, 0xdd, 0xdd, 0xd8, 0x33, 0x33, 0xc8, 0x33, 0x32, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x0b, 0x78, 0xc0, 0x00, 0x00, 0x00, 0xc8, 0x8c, 0x00, 0x00, 0x00, 0x0c, 0x88, 0xc0, 0x00, 0x00, 0x00, 0xc8, 0x8c, 0x00, 0x00, 0x00, 0x0c, 0x88, 0xc0, 0x00, 0x00, 0x00, 0xc8, 0x8c, 0x00, 0x00, 0x00, 0x0c, 0x88, 0xc0, 0x00, 0x00, 0x00, 0xc8, 0x7c, 0x00, 0x00, 0x00, 0x0c, 0x76, 0xd0, 0x00, 0x00, 0x00, 0xd6, 0x2e, 0x60, 0x00, 0x00, 0x5e, 0x10, 0x9d, 0x60, 0x00, 0x5d, 0x80, 0x00, 0x8d, 0xed, 0xdd, 0x80, 0x00, 0x00, 0x04, 0x53, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x0c, 0x7a, 0xb0, 0x00, 0x00, 0x04, 0xe2, 0x4e, 0x10, 0x00, 0x00, 0xab, 0x00, 0xc7, 0x00, 0x00, 0x0d, 0x60, 0x09, 0xc0, 0x00, 0x06, 0xd0, 0x00, 0x3e, 0x30, 0x00, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x2e, 0x40, 0x00, 0x07, 0xd0, 0x08, 0xc0, 0x00, 0x00, 0x1e, 0x50, 0xc9, 0x00, 0x00, 0x00, 0xaa, 0x3e, 0x30, 0x00, 0x00, 0x06, 0xd8, 0xb0, 0x00, 0x00, 0x00, 0x0d, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x10, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x0a, 0xb0, 0x00, 0x00, 0x8b, 0x6d, 0x00, 0x00, 0x0d, 0xe1, 0x00, 0x00, 0xb9, 0x1e, 0x40, 0x00, 0x5d, 0xc7, 0x00, 0x00, 0xe5, 0x0c, 0x80, 0x00, 0x9a, 0x9a, 0x00, 0x05, 0xe0, 0x09, 0xb0, 0x00, 0xc7, 0x5d, 0x00, 0x09, 0xb0, 0x05, 0xe0, 0x02, 0xe1, 0x0d, 0x40, 0x0c, 0x80, 0x00, 0xe5, 0x07, 0xc0, 0x0b, 0x90, 0x2e, 0x30, 0x00, 0xb9, 0x0a, 0x90, 0x07, 0xc0, 0x7d, 0x00, 0x00, 0x8c, 0x0d, 0x50, 0x02, 0xe2, 0xaa, 0x00, 0x00, 0x3e, 0x4d, 0x00, 0x00, 0xc7, 0xd7, 0x00, 0x00, 0x0d, 0xab, 0x00, 0x00, 0x9a, 0xe2, 0x00, 0x00, 0x0a, 0xe7, 0x00, 0x00, 0x5e, 0xc0, 0x00, 0x00, 0x07, 0xe2, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x7c, 0x00, 0x00, 0x01, 0xc6, 0x0c, 0x80, 0x00, 0x09, 0xb0, 0x05, 0xe3, 0x00, 0x4e, 0x30, 0x00, 0xab, 0x00, 0xc8, 0x00, 0x00, 0x1d, 0x78, 0xc0, 0x00, 0x00, 0x06, 0xdd, 0x40, 0x00, 0x00, 0x01, 0xdc, 0x00, 0x00, 0x00, 0x09, 0xbd, 0x80, 0x00, 0x00, 0x4d, 0x35, 0xe3, 0x00, 0x00, 0xc8, 0x00, 0xab, 0x00, 0x08, 0xc0, 0x00, 0x2d, 0x60, 0x3e, 0x40, 0x00, 0x07, 0xd2, 0xb9, 0x00, 0x00, 0x00, 0xba, 0xb8, 0x00, 0x00, 0x00, 0xb8, 0x7d, 0x10, 0x00, 0x06, 0xd2, 0x0c, 0x90, 0x00, 0x0c, 0x80, 0x05, 0xe2, 0x00, 0x7d, 0x00, 0x00, 0xb9, 0x00, 0xd7, 0x00, 0x00, 0x4e, 0x38, 0xc0, 0x00, 0x00, 0x0a, 0xad, 0x60, 0x00, 0x00, 0x03, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x0d, 0xdd, 0xdd, 0xdd, 0xd8, 0x03, 0x44, 0x44, 0x47, 0xe4, 0x00, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x05, 0xe4, 0x00, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x05, 0xe4, 0x00, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x05, 0xe4, 0x00, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xee, 0xee, 0xee, 0xeb, 0x9d, 0xdd, 0x7a, 0xa1, 0x10, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x22, 0x19, 0xdd, 0xd7, 0xa8, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x1e, 0x40, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x03, 0xe2, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x01, 0xe4, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x5d, 0x00, 0x9d, 0xdd, 0x61, 0x11, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x12, 0x2c, 0x79, 0xdd, 0xd6, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x02, 0xdc, 0x50, 0x00, 0x00, 0x09, 0x96, 0xc0, 0x00, 0x00, 0x2d, 0x20, 0xc5, 0x00, 0x00, 0x9a, 0x00, 0x6c, 0x00, 0x02, 0xd2, 0x00, 0x0c, 0x60, 0x09, 0xa0, 0x00, 0x06, 0xc0, 0x2d, 0x30, 0x00, 0x00, 0xc6, 0x13, 0x00, 0x00, 0x00, 0x22, 0x18, 0x88, 0x88, 0x88, 0x61, 0x99, 0x99, 0x99, 0x96, 0x3c, 0x50, 0x00, 0x8d, 0x20, 0x00, 0x8b, 0x00, 0x00, 0x30, 0x00, 0x6a, 0xcb, 0x91, 0x00, 0x2c, 0x85, 0x6c, 0xb0, 0x00, 0x00, 0x00, 0x3e, 0x20, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x17, 0x9a, 0xbe, 0x50, 0x7d, 0xb8, 0x66, 0xd5, 0x1e, 0x70, 0x00, 0x0e, 0x54, 0xe0, 0x00, 0x05, 0xf5, 0x2e, 0x60, 0x03, 0xcd, 0x50, 0x7e, 0xcc, 0xd6, 0xc5, 0x00, 0x15, 0x40, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x9b, 0x3a, 0xcc, 0x81, 0x09, 0xbc, 0x85, 0x6c, 0xb0, 0x9e, 0x50, 0x00, 0x1e, 0x79, 0xd0, 0x00, 0x00, 0xab, 0x9b, 0x00, 0x00, 0x08, 0xc9, 0xb0, 0x00, 0x00, 0x8c, 0x9c, 0x00, 0x00, 0x09, 0xb9, 0xe2, 0x00, 0x00, 0xc8, 0x9d, 0xa0, 0x00, 0x8d, 0x29, 0x89, 0xdc, 0xdd, 0x50, 0x00, 0x02, 0x53, 0x00, 0x00, 0x00, 0x7b, 0xcb, 0x90, 0xbd, 0x85, 0x79, 0x8d, 0x20, 0x00, 0x0c, 0x80, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x0e, 0x40, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x4e, 0x70, 0x00, 0x30, 0x6d, 0xdc, 0xdc, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x50, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x02, 0x9c, 0xc9, 0x1d, 0x61, 0xdb, 0x65, 0x8c, 0xd6, 0x9c, 0x00, 0x00, 0x8e, 0x6c, 0x80, 0x00, 0x02, 0xe6, 0xe5, 0x00, 0x00, 0x0d, 0x6e, 0x40, 0x00, 0x00, 0xd6, 0xd6, 0x00, 0x00, 0x0e, 0x6b, 0xa0, 0x00, 0x05, 0xf6, 0x6e, 0x50, 0x02, 0xcd, 0x60, 0x8e, 0xdc, 0xd6, 0xb6, 0x00, 0x15, 0x40, 0x00, 0x00, 0x01, 0x8b, 0xca, 0x30, 0x0c, 0xc6, 0x59, 0xd3, 0x8c, 0x00, 0x00, 0xaa, 0xc8, 0x00, 0x00, 0x6d, 0xeb, 0xaa, 0xaa, 0xbe, 0xe9, 0x88, 0x88, 0x87, 0xd6, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x4e, 0x70, 0x00, 0x25, 0x05, 0xdd, 0xcd, 0xd8, 0x00, 0x03, 0x54, 0x10, 0x00, 0x19, 0xcc, 0x70, 0x0a, 0xc5, 0x54, 0x00, 0xe5, 0x00, 0x00, 0x0e, 0x20, 0x00, 0x7a, 0xfb, 0xb5, 0x06, 0x7f, 0x77, 0x30, 0x00, 0xf2, 0x00, 0x00, 0x0f, 0x20, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x0f, 0x20, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x0f, 0x20, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x0f, 0x20, 0x00, 0x02, 0x9c, 0xca, 0x28, 0x41, 0xcb, 0x65, 0x9c, 0xd6, 0x9c, 0x00, 0x00, 0x7f, 0x6c, 0x70, 0x00, 0x01, 0xe6, 0xe5, 0x00, 0x00, 0x0d, 0x6e, 0x40, 0x00, 0x00, 0xd6, 0xd6, 0x00, 0x00, 0x0e, 0x6b, 0xa0, 0x00, 0x05, 0xf6, 0x6e, 0x50, 0x03, 0xce, 0x60, 0x8e, 0xcc, 0xd7, 0xd6, 0x00, 0x15, 0x41, 0x0d, 0x50, 0x00, 0x00, 0x02, 0xe3, 0x32, 0x00, 0x01, 0xac, 0x07, 0xec, 0xbb, 0xdc, 0x40, 0x01, 0x57, 0x74, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x9b, 0x3a, 0xcc, 0x91, 0x09, 0xbc, 0x85, 0x7c, 0xb0, 0x9e, 0x40, 0x00, 0x3e, 0x39, 0xc0, 0x00, 0x00, 0xd6, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x12, 0xac, 0x56, 0x00, 0x68, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x00, 0x12, 0x00, 0xac, 0x00, 0x56, 0x00, 0x00, 0x00, 0x68, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0xaa, 0xbb, 0xe4, 0x67, 0x30, 0x79, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x01, 0xa5, 0x9b, 0x00, 0x1b, 0xa0, 0x9b, 0x00, 0xbb, 0x00, 0x9b, 0x0a, 0xc1, 0x00, 0x9b, 0x9e, 0x20, 0x00, 0x9d, 0xcc, 0x90, 0x00, 0x9d, 0x23, 0xe6, 0x00, 0x9b, 0x00, 0x6e, 0x30, 0x9b, 0x00, 0x0a, 0xc0, 0x9b, 0x00, 0x01, 0xca, 0x79, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x66, 0x4a, 0xcb, 0x50, 0x5b, 0xcb, 0x50, 0x9b, 0xc7, 0x59, 0xe8, 0xd7, 0x59, 0xe4, 0x9e, 0x30, 0x00, 0xbe, 0x30, 0x00, 0xb9, 0x9c, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x66, 0x2a, 0xcb, 0x91, 0x09, 0xbc, 0x85, 0x7c, 0xb0, 0x9e, 0x50, 0x00, 0x3e, 0x39, 0xc0, 0x00, 0x00, 0xd5, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x9b, 0x00, 0x00, 0x0d, 0x69, 0xb0, 0x00, 0x00, 0xd6, 0x01, 0x8b, 0xcb, 0x50, 0x01, 0xcc, 0x75, 0x8d, 0x80, 0x8d, 0x00, 0x00, 0x5e, 0x3c, 0x80, 0x00, 0x00, 0xc8, 0xe5, 0x00, 0x00, 0x0a, 0xae, 0x40, 0x00, 0x00, 0xaa, 0xd6, 0x00, 0x00, 0x0b, 0x9a, 0xa0, 0x00, 0x01, 0xe6, 0x3e, 0x70, 0x01, 0xbc, 0x00, 0x6d, 0xdc, 0xeb, 0x20, 0x00, 0x04, 0x52, 0x00, 0x00, 0x67, 0x2a, 0xcc, 0x91, 0x09, 0xac, 0x85, 0x6c, 0xc0, 0x9e, 0x60, 0x00, 0x1d, 0x79, 0xd0, 0x00, 0x00, 0xab, 0x9b, 0x00, 0x00, 0x08, 0xc9, 0xb0, 0x00, 0x00, 0x7c, 0x9c, 0x00, 0x00, 0x09, 0xb9, 0xe2, 0x00, 0x00, 0xc9, 0x9d, 0xb1, 0x00, 0x9e, 0x29, 0xb8, 0xdc, 0xdd, 0x50, 0x9b, 0x01, 0x44, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x02, 0x9c, 0xc9, 0x28, 0x42, 0xdb, 0x65, 0x9c, 0xc5, 0x9c, 0x00, 0x00, 0x8f, 0x5d, 0x70, 0x00, 0x02, 0xe5, 0xe5, 0x00, 0x00, 0x0e, 0x5e, 0x40, 0x00, 0x00, 0xd5, 0xe5, 0x00, 0x00, 0x0e, 0x5c, 0x90, 0x00, 0x05, 0xf5, 0x6e, 0x50, 0x03, 0xcd, 0x50, 0x8e, 0xcc, 0xd6, 0xd5, 0x00, 0x15, 0x40, 0x0d, 0x50, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x0d, 0x50, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x06, 0x20, 0x67, 0x3a, 0xca, 0x9a, 0xd9, 0x66, 0x9e, 0x60, 0x00, 0x9d, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x01, 0x8b, 0xcb, 0x93, 0x0b, 0xb6, 0x57, 0xa4, 0x0e, 0x20, 0x00, 0x00, 0x0d, 0x70, 0x00, 0x00, 0x06, 0xdc, 0x82, 0x00, 0x00, 0x07, 0xbe, 0x90, 0x00, 0x00, 0x04, 0xd8, 0x00, 0x00, 0x00, 0x9b, 0x35, 0x00, 0x02, 0xc8, 0x4d, 0xdc, 0xcd, 0xa0, 0x00, 0x25, 0x51, 0x00, 0x02, 0xb0, 0x00, 0x06, 0xc0, 0x00, 0x7c, 0xdb, 0xb8, 0x6a, 0xc7, 0x75, 0x08, 0xc0, 0x00, 0x08, 0xc0, 0x00, 0x08, 0xc0, 0x00, 0x08, 0xc0, 0x00, 0x08, 0xc0, 0x00, 0x08, 0xc0, 0x00, 0x06, 0xe2, 0x00, 0x00, 0xbd, 0xca, 0x00, 0x04, 0x51, 0x77, 0x00, 0x00, 0x0a, 0x3a, 0xa0, 0x00, 0x00, 0xe4, 0xaa, 0x00, 0x00, 0x0e, 0x4a, 0xa0, 0x00, 0x00, 0xe4, 0xaa, 0x00, 0x00, 0x0e, 0x4a, 0xa0, 0x00, 0x00, 0xe4, 0xaa, 0x00, 0x00, 0x1e, 0x49, 0xb0, 0x00, 0x06, 0xf4, 0x6e, 0x50, 0x03, 0xce, 0x40, 0x9e, 0xcc, 0xc5, 0xc4, 0x00, 0x25, 0x30, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x09, 0x5b, 0xa0, 0x00, 0x03, 0xe3, 0x6d, 0x00, 0x00, 0x9b, 0x00, 0xd6, 0x00, 0x0d, 0x70, 0x09, 0xb0, 0x05, 0xd0, 0x00, 0x3e, 0x20, 0xaa, 0x00, 0x00, 0xc8, 0x1e, 0x40, 0x00, 0x07, 0xc7, 0xc0, 0x00, 0x00, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0xae, 0x20, 0x00, 0x86, 0x00, 0x00, 0xa5, 0x00, 0x03, 0xa9, 0xb0, 0x00, 0x5e, 0xb0, 0x00, 0x8c, 0x5e, 0x00, 0x0a, 0xad, 0x00, 0x0b, 0x90, 0xe5, 0x00, 0xd5, 0xd6, 0x00, 0xd5, 0x0b, 0x90, 0x5d, 0x09, 0xa0, 0x4e, 0x00, 0x8c, 0x09, 0xa0, 0x5d, 0x08, 0xb0, 0x03, 0xe1, 0xd5, 0x00, 0xd5, 0xb8, 0x00, 0x0c, 0x8d, 0x00, 0x0a, 0x9e, 0x30, 0x00, 0xad, 0xa0, 0x00, 0x6d, 0xd0, 0x00, 0x06, 0xf6, 0x00, 0x00, 0xea, 0x00, 0x5a, 0x10, 0x00, 0x1a, 0x40, 0xca, 0x00, 0x0a, 0xc0, 0x03, 0xd6, 0x06, 0xd3, 0x00, 0x07, 0xd3, 0xd7, 0x00, 0x00, 0x0a, 0xea, 0x00, 0x00, 0x00, 0x9e, 0x90, 0x00, 0x00, 0x5e, 0x5d, 0x50, 0x00, 0x1d, 0x70, 0x7d, 0x20, 0x0a, 0xb0, 0x00, 0xba, 0x07, 0xd2, 0x00, 0x02, 0xd7, 0xa4, 0x00, 0x00, 0x09, 0x6a, 0xa0, 0x00, 0x03, 0xe3, 0x5d, 0x10, 0x00, 0x9b, 0x00, 0xd7, 0x00, 0x0d, 0x70, 0x08, 0xb0, 0x05, 0xe1, 0x00, 0x2e, 0x30, 0xaa, 0x00, 0x00, 0xb9, 0x1e, 0x40, 0x00, 0x06, 0xd7, 0xc0, 0x00, 0x00, 0x0d, 0xc8, 0x00, 0x00, 0x00, 0x9e, 0x20, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x0a, 0xbe, 0x50, 0x00, 0x00, 0x77, 0x30, 0x00, 0x00, 0x00, 0x0a, 0xbb, 0xbb, 0xb7, 0x06, 0x77, 0x77, 0xe7, 0x00, 0x00, 0x0a, 0xb0, 0x00, 0x00, 0x6d, 0x20, 0x00, 0x02, 0xd6, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x7d, 0x10, 0x00, 0x03, 0xd5, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x6f, 0xdd, 0xdd, 0xda, 0x00, 0x06, 0xcc, 0x00, 0x4e, 0x83, 0x00, 0x8c, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0xb9, 0x00, 0x6b, 0xc3, 0x00, 0x6b, 0xc3, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x4e, 0x83, 0x00, 0x06, 0xbc, 0x96, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0x64, 0x8d, 0x91, 0x00, 0x14, 0xca, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x2e, 0x30, 0x00, 0x09, 0xca, 0x00, 0x09, 0xca, 0x00, 0x2e, 0x30, 0x00, 0x5d, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x6d, 0x00, 0x15, 0xca, 0x00, 0x8c, 0x91, 0x00, 0x01, 0x67, 0x30, 0x00, 0x02, 0x1c, 0xbb, 0xdc, 0x87, 0xb7, 0x15, 0x00, 0x07, 0xab, 0x70, ]; /// Glyph metadata for binary search pub const NOTO_SANS_18_LIGHT_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 5, data_offset: 0, }, GlyphInfo { character: '!', width: 2, height: 14, x_offset: 1, y_offset: 1, x_advance: 4, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 5, x_offset: 1, y_offset: 1, x_advance: 7, data_offset: 14, }, GlyphInfo { character: '#', width: 12, height: 13, x_offset: 0, y_offset: 1, x_advance: 12, data_offset: 27, }, GlyphInfo { character: '$', width: 8, height: 16, x_offset: 1, y_offset: 0, x_advance: 10, data_offset: 105, }, GlyphInfo { character: '%', width: 14, height: 15, x_offset: 0, y_offset: 0, x_advance: 15, data_offset: 169, }, GlyphInfo { character: '&', width: 12, height: 15,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_18_medium.rs
frostsnap_fonts/src/noto_sans_18_medium.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 18px //! Weight: 500 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_18_MEDIUM_DATA: &[u8] = &[ 0xad, 0xab, 0xfa, 0xaf, 0x9a, 0xf9, 0x9f, 0x89, 0xf8, 0x8f, 0x77, 0xf6, 0x7f, 0x52, 0x62, 0x37, 0x2c, 0xfb, 0xbf, 0xa2, 0x61, 0xcd, 0x37, 0xd9, 0xce, 0x17, 0xf9, 0xbe, 0x06, 0xf8, 0xbd, 0x04, 0xf7, 0x9b, 0x02, 0xd5, 0x00, 0x00, 0xac, 0x00, 0xca, 0x00, 0x00, 0x00, 0xdb, 0x02, 0xe9, 0x00, 0x00, 0x02, 0xe9, 0x06, 0xf6, 0x00, 0x03, 0x47, 0xf8, 0x49, 0xe4, 0x41, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xf5, 0x07, 0x7c, 0xd7, 0x7e, 0xc7, 0x72, 0x00, 0x0d, 0xb0, 0x2e, 0x90, 0x00, 0x24, 0x4e, 0xa4, 0x7f, 0x84, 0x20, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x57, 0xbf, 0x87, 0xce, 0x77, 0x50, 0x00, 0xae, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xcc, 0x01, 0xe9, 0x00, 0x00, 0x00, 0xea, 0x06, 0xf7, 0x00, 0x00, 0x00, 0x07, 0x90, 0x00, 0x00, 0x01, 0xac, 0x30, 0x00, 0x2b, 0xef, 0xff, 0xeb, 0x0b, 0xfd, 0xcd, 0xad, 0xb0, 0xee, 0x29, 0xc0, 0x01, 0x0e, 0xe5, 0x9c, 0x00, 0x00, 0x9f, 0xed, 0xd2, 0x00, 0x00, 0x8d, 0xff, 0xea, 0x30, 0x00, 0x0a, 0xee, 0xfd, 0x20, 0x00, 0x9c, 0x1c, 0xf7, 0x30, 0x09, 0xc0, 0xbf, 0x7e, 0xca, 0xcd, 0xce, 0xd2, 0xce, 0xff, 0xfe, 0xb4, 0x00, 0x03, 0xac, 0x00, 0x00, 0x00, 0x09, 0xc0, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xed, 0x50, 0x00, 0x0c, 0xc0, 0x00, 0x0c, 0xd8, 0xdd, 0x00, 0x08, 0xf7, 0x00, 0x03, 0xe9, 0x08, 0xf5, 0x01, 0xdc, 0x00, 0x00, 0x5f, 0x80, 0x6f, 0x70, 0x9e, 0x50, 0x00, 0x05, 0xf8, 0x06, 0xf7, 0x3e, 0xb0, 0x00, 0x00, 0x2e, 0xa0, 0x8f, 0x5a, 0xe4, 0xbd, 0xc6, 0x00, 0xce, 0x8d, 0xd4, 0xea, 0x9e, 0xad, 0xe2, 0x04, 0xdf, 0xd6, 0xbe, 0x2d, 0xc0, 0x6f, 0x80, 0x00, 0x10, 0x6e, 0x90, 0xeb, 0x02, 0xf9, 0x00, 0x00, 0x0c, 0xd1, 0x0e, 0xa0, 0x1f, 0xa0, 0x00, 0x07, 0xf7, 0x00, 0xdc, 0x04, 0xf9, 0x00, 0x01, 0xdc, 0x00, 0x0a, 0xe7, 0xbe, 0x40, 0x00, 0x9e, 0x50, 0x00, 0x3d, 0xfe, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xef, 0xea, 0x10, 0x00, 0x00, 0x00, 0xbf, 0xca, 0xdf, 0x90, 0x00, 0x00, 0x00, 0xee, 0x10, 0x5f, 0xc0, 0x00, 0x00, 0x00, 0xde, 0x20, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x9f, 0xb6, 0xee, 0x50, 0x00, 0x00, 0x00, 0x1c, 0xfe, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x9e, 0xff, 0xb0, 0x00, 0x7a, 0x60, 0x09, 0xfd, 0x7d, 0xfb, 0x00, 0xcf, 0x50, 0x1e, 0xf5, 0x03, 0xdf, 0xb6, 0xed, 0x00, 0x3f, 0xe0, 0x00, 0x2c, 0xfe, 0xf7, 0x00, 0x1e, 0xf6, 0x00, 0x06, 0xef, 0xd1, 0x00, 0x0b, 0xfe, 0xba, 0xbe, 0xed, 0xfc, 0x10, 0x01, 0xae, 0xff, 0xec, 0x62, 0xcf, 0xc2, 0x00, 0x01, 0x45, 0x20, 0x00, 0x00, 0x00, 0xcd, 0x3c, 0xe1, 0xbe, 0x0b, 0xd0, 0x9b, 0x00, 0x00, 0x2c, 0xc0, 0x00, 0xae, 0x60, 0x04, 0xec, 0x00, 0x0a, 0xf8, 0x00, 0x0d, 0xe2, 0x00, 0x2e, 0xd0, 0x00, 0x5f, 0xb0, 0x00, 0x7f, 0xb0, 0x00, 0x7f, 0xa0, 0x00, 0x6f, 0xb0, 0x00, 0x3f, 0xd0, 0x00, 0x0d, 0xe2, 0x00, 0x0a, 0xf7, 0x00, 0x04, 0xec, 0x00, 0x00, 0xbe, 0x60, 0x00, 0x2c, 0xb0, 0x5d, 0x90, 0x00, 0xbe, 0x50, 0x04, 0xec, 0x00, 0x0c, 0xe4, 0x00, 0x9f, 0x90, 0x05, 0xfb, 0x00, 0x2f, 0xd0, 0x00, 0xed, 0x00, 0x0e, 0xd0, 0x02, 0xfd, 0x00, 0x5f, 0xc0, 0x09, 0xf9, 0x00, 0xcf, 0x50, 0x4e, 0xc0, 0x0b, 0xe6, 0x05, 0xd9, 0x00, 0x00, 0x01, 0xca, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x14, 0x00, 0xdb, 0x00, 0x40, 0x5e, 0xda, 0xdc, 0xad, 0xe1, 0x5b, 0xcd, 0xff, 0xdc, 0xb3, 0x00, 0x0b, 0xee, 0x90, 0x00, 0x00, 0x8f, 0x9b, 0xe6, 0x00, 0x02, 0xde, 0x25, 0xec, 0x00, 0x00, 0x27, 0x00, 0x71, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x13, 0x33, 0xbe, 0x33, 0x32, 0x5f, 0xff, 0xff, 0xff, 0xf9, 0x28, 0x88, 0xce, 0x88, 0x85, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x02, 0x42, 0x0a, 0xfa, 0x0c, 0xf5, 0x0e, 0xd0, 0x4f, 0x90, 0x38, 0x20, 0x6b, 0xbb, 0xb3, 0x8f, 0xff, 0xf4, 0x37, 0x2c, 0xfb, 0xbf, 0xa2, 0x61, 0x00, 0x00, 0x5e, 0xa0, 0x00, 0x0a, 0xf6, 0x00, 0x01, 0xed, 0x00, 0x00, 0x7f, 0xa0, 0x00, 0x0c, 0xf5, 0x00, 0x03, 0xec, 0x00, 0x00, 0x9f, 0x90, 0x00, 0x0d, 0xe3, 0x00, 0x05, 0xfb, 0x00, 0x00, 0xaf, 0x70, 0x00, 0x1e, 0xe1, 0x00, 0x07, 0xfa, 0x00, 0x00, 0xbf, 0x50, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5c, 0xee, 0xd7, 0x00, 0x04, 0xee, 0xcb, 0xee, 0x60, 0x0a, 0xf9, 0x00, 0x6f, 0xc0, 0x0d, 0xe3, 0x00, 0x0d, 0xf4, 0x2e, 0xd0, 0x00, 0x0b, 0xf7, 0x4f, 0xc0, 0x00, 0x0a, 0xf9, 0x5f, 0xc0, 0x00, 0x09, 0xf9, 0x4f, 0xc0, 0x00, 0x0a, 0xf9, 0x2f, 0xd0, 0x00, 0x0b, 0xf8, 0x0d, 0xe2, 0x00, 0x0c, 0xf5, 0x0a, 0xf8, 0x00, 0x5e, 0xe0, 0x04, 0xee, 0xaa, 0xef, 0x80, 0x00, 0x6d, 0xff, 0xe9, 0x00, 0x00, 0x00, 0x45, 0x10, 0x00, 0x00, 0x08, 0xdb, 0x02, 0xbf, 0xfc, 0x4d, 0xfb, 0xfc, 0x6e, 0x85, 0xfc, 0x03, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x05, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x9d, 0xee, 0xd8, 0x00, 0x1d, 0xfe, 0xbc, 0xef, 0x80, 0x08, 0x91, 0x00, 0x7f, 0xd0, 0x00, 0x00, 0x00, 0x0e, 0xe0, 0x00, 0x00, 0x00, 0x4f, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0x90, 0x00, 0x00, 0x07, 0xed, 0x10, 0x00, 0x00, 0x7e, 0xd4, 0x00, 0x00, 0x06, 0xed, 0x40, 0x00, 0x00, 0x6e, 0xd4, 0x00, 0x00, 0x06, 0xed, 0x40, 0x00, 0x00, 0x4e, 0xfd, 0xcc, 0xcc, 0xc7, 0x5f, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x00, 0x10, 0x00, 0x00, 0x05, 0xbe, 0xee, 0xd8, 0x00, 0x2e, 0xed, 0xbb, 0xef, 0xa0, 0x06, 0x50, 0x00, 0x6f, 0xe0, 0x00, 0x00, 0x00, 0x0e, 0xe0, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x49, 0x9b, 0xec, 0x30, 0x00, 0x7f, 0xff, 0xd8, 0x10, 0x00, 0x25, 0x57, 0xcf, 0xc0, 0x00, 0x00, 0x00, 0x0d, 0xf6, 0x00, 0x00, 0x00, 0x0c, 0xf7, 0x22, 0x00, 0x00, 0x4e, 0xf5, 0x6e, 0xba, 0x9a, 0xef, 0xb0, 0x4c, 0xef, 0xff, 0xea, 0x10, 0x00, 0x24, 0x54, 0x00, 0x00, 0x00, 0x00, 0x03, 0xde, 0x50, 0x00, 0x00, 0x0c, 0xff, 0x50, 0x00, 0x00, 0x8f, 0xdf, 0x50, 0x00, 0x04, 0xeb, 0xbf, 0x50, 0x00, 0x1c, 0xe3, 0xcf, 0x50, 0x00, 0x9e, 0x70, 0xcf, 0x50, 0x05, 0xea, 0x00, 0xcf, 0x50, 0x1d, 0xd2, 0x00, 0xcf, 0x50, 0xaf, 0xb9, 0x99, 0xdf, 0xa9, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0x45, 0x55, 0x55, 0xcf, 0x75, 0x00, 0x00, 0x00, 0xcf, 0x50, 0x00, 0x00, 0x00, 0xcf, 0x50, 0x5d, 0xdd, 0xdd, 0xd8, 0x07, 0xfe, 0xdd, 0xdd, 0x80, 0x8f, 0x90, 0x00, 0x00, 0x09, 0xf8, 0x00, 0x00, 0x00, 0xaf, 0x70, 0x00, 0x00, 0x0b, 0xfd, 0xee, 0xd8, 0x00, 0x8d, 0xcb, 0xce, 0xfa, 0x00, 0x00, 0x00, 0x6e, 0xe4, 0x00, 0x00, 0x00, 0xcf, 0x70, 0x00, 0x00, 0x0c, 0xf6, 0x30, 0x00, 0x04, 0xee, 0x3e, 0xca, 0x9a, 0xef, 0x90, 0xbe, 0xff, 0xfd, 0x80, 0x00, 0x14, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xbd, 0xee, 0xa0, 0x00, 0x7e, 0xec, 0xaa, 0x80, 0x03, 0xee, 0x60, 0x00, 0x00, 0x09, 0xf9, 0x00, 0x00, 0x00, 0x0c, 0xe2, 0x03, 0x30, 0x00, 0x0e, 0xd8, 0xef, 0xfc, 0x50, 0x2f, 0xee, 0xa9, 0xbf, 0xd2, 0x3f, 0xe6, 0x00, 0x0c, 0xf8, 0x2f, 0xd0, 0x00, 0x09, 0xfa, 0x0e, 0xe1, 0x00, 0x09, 0xf9, 0x0b, 0xf9, 0x00, 0x0c, 0xf6, 0x04, 0xee, 0xb9, 0xcf, 0xc0, 0x00, 0x5c, 0xff, 0xeb, 0x30, 0x00, 0x00, 0x35, 0x20, 0x00, 0x7d, 0xdd, 0xdd, 0xdd, 0xd9, 0x6d, 0xdd, 0xdd, 0xde, 0xf9, 0x00, 0x00, 0x00, 0x0d, 0xe3, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0xcf, 0x50, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x0c, 0xf7, 0x00, 0x00, 0x00, 0x5e, 0xd0, 0x00, 0x00, 0x00, 0xbf, 0x80, 0x00, 0x00, 0x04, 0xee, 0x20, 0x00, 0x00, 0x0a, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0xe3, 0x00, 0x00, 0x00, 0x9f, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7c, 0xee, 0xd9, 0x10, 0x07, 0xee, 0xaa, 0xdf, 0xb0, 0x0c, 0xf6, 0x00, 0x2e, 0xe1, 0x0c, 0xf4, 0x00, 0x0d, 0xe1, 0x09, 0xfc, 0x20, 0x9f, 0xb0, 0x00, 0xbf, 0xec, 0xfb, 0x20, 0x00, 0x5e, 0xff, 0xe7, 0x00, 0x06, 0xed, 0x78, 0xdf, 0xa0, 0x1e, 0xe4, 0x00, 0x3d, 0xf6, 0x5f, 0xc0, 0x00, 0x09, 0xf9, 0x3f, 0xd1, 0x00, 0x0b, 0xf8, 0x0c, 0xfc, 0x88, 0xbe, 0xd2, 0x02, 0xbe, 0xff, 0xec, 0x40, 0x00, 0x01, 0x45, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xee, 0xc6, 0x00, 0x07, 0xee, 0xbb, 0xee, 0x60, 0x0d, 0xe6, 0x00, 0x6e, 0xd0, 0x4f, 0xd0, 0x00, 0x0c, 0xf5, 0x5f, 0xc0, 0x00, 0x0a, 0xf8, 0x3e, 0xe1, 0x00, 0x0c, 0xf9, 0x0c, 0xfc, 0x77, 0xce, 0xf8, 0x03, 0xcf, 0xff, 0xca, 0xf7, 0x00, 0x05, 0x75, 0x0b, 0xf4, 0x00, 0x00, 0x00, 0x2e, 0xd0, 0x00, 0x00, 0x01, 0xbf, 0x90, 0x05, 0x98, 0xad, 0xfc, 0x10, 0x07, 0xff, 0xfd, 0x91, 0x00, 0x01, 0x45, 0x40, 0x00, 0x00, 0x9e, 0x8c, 0xfb, 0x7b, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x72, 0xcf, 0xbb, 0xfa, 0x26, 0x10, 0x09, 0xe8, 0x0c, 0xfb, 0x07, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x42, 0x0b, 0xf8, 0x0d, 0xe3, 0x2e, 0xc0, 0x6f, 0x70, 0x48, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xb8, 0x00, 0x00, 0x04, 0xbe, 0xe7, 0x00, 0x04, 0xbe, 0xea, 0x30, 0x04, 0xbe, 0xd9, 0x20, 0x00, 0x4e, 0xe9, 0x10, 0x00, 0x00, 0x2a, 0xee, 0xb6, 0x00, 0x00, 0x00, 0x29, 0xdf, 0xd9, 0x20, 0x00, 0x00, 0x07, 0xce, 0xe7, 0x00, 0x00, 0x00, 0x05, 0xb8, 0x2d, 0xdd, 0xdd, 0xdd, 0xd7, 0x2b, 0xbb, 0xbb, 0xbb, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x77, 0x77, 0x77, 0x74, 0x3f, 0xff, 0xff, 0xff, 0xf8, 0x15, 0x55, 0x55, 0x55, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x60, 0x00, 0x00, 0x00, 0x3d, 0xfc, 0x60, 0x00, 0x00, 0x01, 0x8d, 0xfc, 0x60, 0x00, 0x00, 0x00, 0x7c, 0xfc, 0x60, 0x00, 0x00, 0x00, 0x7e, 0xf8, 0x00, 0x00, 0x4a, 0xee, 0xb4, 0x00, 0x7c, 0xee, 0xa4, 0x00, 0x3d, 0xfd, 0x92, 0x00, 0x00, 0x4c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x6b, 0xee, 0xec, 0x60, 0xae, 0xdb, 0xce, 0xe5, 0x34, 0x00, 0x09, 0xf9, 0x00, 0x00, 0x07, 0xfa, 0x00, 0x00, 0x1c, 0xf7, 0x00, 0x02, 0xbf, 0xb0, 0x00, 0x0c, 0xfa, 0x00, 0x00, 0x7f, 0xa0, 0x00, 0x00, 0x9f, 0x40, 0x00, 0x00, 0x46, 0x10, 0x00, 0x00, 0x47, 0x20, 0x00, 0x00, 0xdf, 0xa0, 0x00, 0x00, 0xcf, 0x90, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x07, 0xbd, 0xdd, 0xb7, 0x00, 0x00, 0x00, 0x04, 0xde, 0xda, 0x9a, 0xce, 0xd4, 0x00, 0x00, 0x5e, 0xd6, 0x00, 0x00, 0x06, 0xdd, 0x20, 0x01, 0xdd, 0x30, 0x27, 0x98, 0x61, 0x5e, 0xa0, 0x08, 0xf6, 0x06, 0xee, 0xde, 0xf7, 0x0b, 0xe0, 0x0c, 0xd0, 0x1d, 0xd4, 0x07, 0xf6, 0x08, 0xf4, 0x0e, 0xb0, 0x7f, 0x80, 0x08, 0xf6, 0x07, 0xf5, 0x0e, 0xa0, 0x9f, 0x60, 0x09, 0xf5, 0x08, 0xf3, 0x0e, 0xa0, 0x7f, 0x70, 0x0b, 0xf5, 0x0b, 0xd0, 0x0d, 0xc0, 0x3e, 0xd7, 0x9e, 0xea, 0x8e, 0x80, 0x0a, 0xe2, 0x06, 0xde, 0xd6, 0x7e, 0xea, 0x00, 0x05, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xc5, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x07, 0xdf, 0xed, 0xde, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x06, 0x9a, 0xa9, 0x60, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xe3, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xf9, 0x00, 0x00, 0x00, 0x03, 0xec, 0xed, 0x00, 0x00, 0x00, 0x09, 0xf9, 0xbf, 0x50, 0x00, 0x00, 0x0d, 0xe4, 0x7f, 0xa0, 0x00, 0x00, 0x5f, 0xc0, 0x2e, 0xe1, 0x00, 0x00, 0xaf, 0x80, 0x0b, 0xf7, 0x00, 0x01, 0xef, 0x98, 0x8b, 0xfc, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x30, 0x0c, 0xfa, 0x77, 0x77, 0xcf, 0x90, 0x3e, 0xe2, 0x00, 0x00, 0x6f, 0xd0, 0x9f, 0xb0, 0x00, 0x00, 0x0d, 0xf6, 0xdf, 0x60, 0x00, 0x00, 0x09, 0xfb, 0x7d, 0xdd, 0xdd, 0xc9, 0x20, 0x7f, 0xec, 0xcd, 0xef, 0xd2, 0x7f, 0xb0, 0x00, 0x4e, 0xf7, 0x7f, 0xb0, 0x00, 0x0b, 0xf8, 0x7f, 0xb0, 0x00, 0x1d, 0xe5, 0x7f, 0xda, 0xaa, 0xde, 0x90, 0x7f, 0xff, 0xff, 0xfb, 0x60, 0x7f, 0xc4, 0x45, 0x8e, 0xe7, 0x7f, 0xb0, 0x00, 0x08, 0xfc, 0x7f, 0xb0, 0x00, 0x07, 0xfd, 0x7f, 0xb0, 0x00, 0x1c, 0xfb, 0x7f, 0xdb, 0xbb, 0xdf, 0xe5, 0x7f, 0xff, 0xfe, 0xeb, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x29, 0xde, 0xee, 0xc8, 0x04, 0xdf, 0xec, 0xcd, 0xea, 0x1d, 0xfc, 0x30, 0x00, 0x43, 0x8f, 0xd1, 0x00, 0x00, 0x00, 0xcf, 0x90, 0x00, 0x00, 0x00, 0xdf, 0x60, 0x00, 0x00, 0x00, 0xef, 0x40, 0x00, 0x00, 0x00, 0xdf, 0x50, 0x00, 0x00, 0x00, 0xcf, 0x80, 0x00, 0x00, 0x00, 0x9f, 0xc0, 0x00, 0x00, 0x00, 0x3e, 0xfa, 0x00, 0x00, 0x00, 0x07, 0xef, 0xdb, 0xab, 0xd8, 0x00, 0x6c, 0xef, 0xff, 0xd6, 0x00, 0x00, 0x14, 0x53, 0x00, 0x7d, 0xdd, 0xdd, 0xb8, 0x20, 0x00, 0x7f, 0xed, 0xde, 0xff, 0xd5, 0x00, 0x7f, 0xb0, 0x00, 0x4b, 0xfd, 0x30, 0x7f, 0xb0, 0x00, 0x00, 0xcf, 0xa0, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xd0, 0x7f, 0xb0, 0x00, 0x00, 0x2f, 0xe1, 0x7f, 0xb0, 0x00, 0x00, 0x0e, 0xf3, 0x7f, 0xb0, 0x00, 0x00, 0x2f, 0xe0, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xd0, 0x7f, 0xb0, 0x00, 0x00, 0xcf, 0xa0, 0x7f, 0xb0, 0x00, 0x3b, 0xfd, 0x30, 0x7f, 0xdb, 0xcd, 0xef, 0xd5, 0x00, 0x7f, 0xff, 0xee, 0xc9, 0x20, 0x00, 0x7d, 0xdd, 0xdd, 0xdd, 0x7f, 0xed, 0xdd, 0xdd, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xda, 0xaa, 0xa8, 0x7f, 0xff, 0xff, 0xfb, 0x7f, 0xc4, 0x44, 0x43, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xec, 0xcc, 0xcb, 0x7f, 0xff, 0xff, 0xfe, 0x7d, 0xdd, 0xdd, 0xdd, 0x7f, 0xed, 0xdd, 0xdc, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfb, 0x7f, 0xdb, 0xbb, 0xb9, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8c, 0xee, 0xed, 0xb6, 0x03, 0xcf, 0xed, 0xcc, 0xef, 0x70, 0xcf, 0xd5, 0x00, 0x00, 0x60, 0x7f, 0xe3, 0x00, 0x00, 0x00, 0x0b, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x60, 0x00, 0x00, 0x00, 0x0e, 0xf4, 0x00, 0x0d, 0xee, 0xeb, 0xdf, 0x50, 0x00, 0xcc, 0xdf, 0xcc, 0xf8, 0x00, 0x00, 0x06, 0xfc, 0x9f, 0xc0, 0x00, 0x00, 0x6f, 0xc3, 0xef, 0xa1, 0x00, 0x06, 0xfc, 0x07, 0xef, 0xdb, 0xaa, 0xcf, 0xc0, 0x05, 0xbe, 0xff, 0xfe, 0xd9, 0x00, 0x00, 0x14, 0x54, 0x20, 0x00, 0x7d, 0xa0, 0x00, 0x00, 0x5d, 0xb7, 0xfb, 0x00, 0x00, 0x06, 0xfc, 0x7f, 0xb0, 0x00, 0x00, 0x6f, 0xc7, 0xfb, 0x00, 0x00, 0x06, 0xfc, 0x7f, 0xb0, 0x00, 0x00, 0x6f, 0xc7, 0xfd, 0xaa, 0xaa, 0xab, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xfc, 0x55, 0x55, 0x57, 0xfc, 0x7f, 0xb0, 0x00, 0x00, 0x6f, 0xc7, 0xfb, 0x00, 0x00, 0x06, 0xfc, 0x7f, 0xb0, 0x00, 0x00, 0x6f, 0xc7, 0xfb, 0x00, 0x00, 0x06, 0xfc, 0x7f, 0xb0, 0x00, 0x00, 0x6f, 0xc0, 0x7d, 0xdd, 0xdb, 0x4a, 0xef, 0xb6, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x00, 0xdf, 0x50, 0x28, 0xef, 0xa5, 0x8f, 0xff, 0xfc, 0x00, 0x07, 0xda, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x08, 0xfb, 0x00, 0x09, 0xfa, 0x45, 0x7e, 0xf6, 0x8f, 0xff, 0xb0, 0x4a, 0xa7, 0x00, 0x7d, 0xa0, 0x00, 0x07, 0xdc, 0x27, 0xfb, 0x00, 0x06, 0xee, 0x40, 0x7f, 0xb0, 0x04, 0xee, 0x60, 0x07, 0xfb, 0x03, 0xde, 0x70, 0x00, 0x7f, 0xb1, 0xcf, 0x90, 0x00, 0x07, 0xfb, 0xbf, 0xb0, 0x00, 0x00, 0x7f, 0xef, 0xfd, 0x10, 0x00, 0x07, 0xfe, 0x9c, 0xfa, 0x00, 0x00, 0x7f, 0xb0, 0x4e, 0xe6, 0x00, 0x07, 0xfb, 0x00, 0x8f, 0xd2, 0x00, 0x7f, 0xb0, 0x00, 0xbf, 0xb0, 0x07, 0xfb, 0x00, 0x03, 0xdf, 0x70, 0x7f, 0xb0, 0x00, 0x06, 0xee, 0x40, 0x7d, 0xa0, 0x00, 0x00, 0x07, 0xfb, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x07, 0xfb, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x07, 0xfb, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x07, 0xfb, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x07, 0xfb, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x07, 0xfe, 0xcc, 0xcc, 0xc3, 0x7f, 0xff, 0xff, 0xff, 0x40, 0x7d, 0xda, 0x00, 0x00, 0x00, 0x4d, 0xdc, 0x7f, 0xfe, 0x20, 0x00, 0x00, 0x9f, 0xfd, 0x7f, 0xdf, 0x80, 0x00, 0x00, 0xdd, 0xed, 0x7f, 0xae, 0xc0, 0x00, 0x05, 0xfa, 0xfd, 0x7f, 0x9c, 0xe3, 0x00, 0x0a, 0xe5, 0xfd, 0x7f, 0x98, 0xf8, 0x00, 0x1e, 0xc3, 0xfd, 0x7f, 0xa2, 0xec, 0x00, 0x7f, 0x83, 0xfd, 0x7f, 0xa0, 0xbe, 0x40, 0xbe, 0x23, 0xfd, 0x7f, 0xa0, 0x7f, 0x93, 0xeb, 0x03, 0xfd, 0x7f, 0xa0, 0x1e, 0xd8, 0xf7, 0x03, 0xfd, 0x7f, 0xa0, 0x0b, 0xfe, 0xe1, 0x03, 0xfd, 0x7f, 0xa0, 0x06, 0xff, 0xa0, 0x03, 0xfd, 0x7f, 0xa0, 0x00, 0xdf, 0x50, 0x03, 0xfd, 0x7d, 0xd7, 0x00, 0x00, 0x09, 0xd6, 0x7f, 0xfd, 0x20, 0x00, 0x0a, 0xf6, 0x7f, 0xef, 0xa0, 0x00, 0x0a, 0xf6, 0x7f, 0x9e, 0xe5, 0x00, 0x0a, 0xf6, 0x7f, 0x99, 0xfc, 0x00, 0x0a, 0xf6, 0x7f, 0x91, 0xdf, 0x90, 0x0a, 0xf6, 0x7f, 0xa0, 0x5e, 0xe4, 0x0a, 0xf6, 0x7f, 0xa0, 0x0a, 0xfb, 0x0a, 0xf6, 0x7f, 0xa0, 0x02, 0xdf, 0x7a, 0xf6, 0x7f, 0xa0, 0x00, 0x7f, 0xda, 0xf6, 0x7f, 0xa0, 0x00, 0x0b, 0xfe, 0xf6, 0x7f, 0xa0, 0x00, 0x04, 0xef, 0xf6, 0x7f, 0xa0, 0x00, 0x00, 0x9f, 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0xad, 0xee, 0xdb, 0x40, 0x00, 0x06, 0xef, 0xec, 0xbd, 0xfe, 0x70, 0x02, 0xdf, 0xa1, 0x00, 0x09, 0xee, 0x30, 0x9f, 0xc0, 0x00, 0x00, 0x0c, 0xfa, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xd0, 0xdf, 0x60, 0x00, 0x00, 0x04, 0xfe, 0x0e, 0xf5, 0x00, 0x00, 0x00, 0x2f, 0xf1, 0xdf, 0x50, 0x00, 0x00, 0x03, 0xfe, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xd0, 0x9f, 0xc0, 0x00, 0x00, 0x0b, 0xfa, 0x03, 0xef, 0x90, 0x00, 0x07, 0xee, 0x50, 0x07, 0xef, 0xda, 0xac, 0xfe, 0x80, 0x00, 0x06, 0xce, 0xff, 0xec, 0x60, 0x00, 0x00, 0x00, 0x25, 0x52, 0x00, 0x00, 0x00, 0x7d, 0xdd, 0xdc, 0xa5, 0x00, 0x7f, 0xed, 0xde, 0xfe, 0x70, 0x7f, 0xb0, 0x02, 0xaf, 0xd0, 0x7f, 0xb0, 0x00, 0x1e, 0xf3, 0x7f, 0xb0, 0x00, 0x0e, 0xf3, 0x7f, 0xb0, 0x00, 0x8f, 0xd0, 0x7f, 0xda, 0xac, 0xee, 0x70, 0x7f, 0xff, 0xfe, 0xc6, 0x00, 0x7f, 0xc4, 0x41, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0xad, 0xee, 0xdb, 0x40, 0x00, 0x06, 0xef, 0xec, 0xbd, 0xfe, 0x70, 0x02, 0xdf, 0xa1, 0x00, 0x09, 0xee, 0x30, 0x9f, 0xc0, 0x00, 0x00, 0x0c, 0xfa, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xd0, 0xdf, 0x60, 0x00, 0x00, 0x04, 0xfe, 0x0e, 0xf5, 0x00, 0x00, 0x00, 0x2f, 0xf1, 0xdf, 0x50, 0x00, 0x00, 0x03, 0xfe, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0xd0, 0x9f, 0xc0, 0x00, 0x00, 0x0b, 0xfa, 0x03, 0xef, 0x90, 0x00, 0x07, 0xee, 0x50, 0x07, 0xef, 0xda, 0xac, 0xfe, 0x80, 0x00, 0x06, 0xce, 0xff, 0xfd, 0x60, 0x00, 0x00, 0x00, 0x25, 0x8e, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x20, 0x7d, 0xdd, 0xdd, 0xb5, 0x00, 0x07, 0xfe, 0xcd, 0xef, 0xe8, 0x00, 0x7f, 0xb0, 0x00, 0x9f, 0xe0, 0x07, 0xfb, 0x00, 0x00, 0xef, 0x30, 0x7f, 0xb0, 0x00, 0x1e, 0xe2, 0x07, 0xfb, 0x00, 0x1a, 0xfc, 0x00, 0x7f, 0xed, 0xde, 0xfc, 0x30, 0x07, 0xfe, 0xdd, 0xfd, 0x10, 0x00, 0x7f, 0xb0, 0x0c, 0xf8, 0x00, 0x07, 0xfb, 0x00, 0x4e, 0xe3, 0x00, 0x7f, 0xb0, 0x00, 0xaf, 0xb0, 0x07, 0xfb, 0x00, 0x02, 0xef, 0x70, 0x7f, 0xb0, 0x00, 0x08, 0xfd, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7c, 0xee, 0xec, 0x80, 0x08, 0xfe, 0xcc, 0xde, 0xa0, 0x0d, 0xf7, 0x00, 0x04, 0x40, 0x0e, 0xf2, 0x00, 0x00, 0x00, 0x0c, 0xf9, 0x00, 0x00, 0x00, 0x06, 0xef, 0xc7, 0x00, 0x00, 0x00, 0x6d, 0xff, 0xd7, 0x00, 0x00, 0x00, 0x7c, 0xff, 0x90, 0x00, 0x00, 0x00, 0x8f, 0xe0, 0x00, 0x00, 0x00, 0x0e, 0xf2, 0x24, 0x00, 0x00, 0x4e, 0xe0, 0x4e, 0xda, 0xab, 0xef, 0x90, 0x3c, 0xef, 0xff, 0xd9, 0x00, 0x00, 0x14, 0x54, 0x00, 0x00, 0xbd, 0xdd, 0xdd, 0xdd, 0xdc, 0xbd, 0xdd, 0xef, 0xdd, 0xdc, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x00, 0x00, 0xef, 0x20, 0x00, 0x8d, 0x90, 0x00, 0x00, 0x6d, 0xb9, 0xfa, 0x00, 0x00, 0x06, 0xfc, 0x9f, 0xa0, 0x00, 0x00, 0x6f, 0xc9, 0xfa, 0x00, 0x00, 0x06, 0xfc, 0x9f, 0xa0, 0x00, 0x00, 0x6f, 0xc9, 0xfa, 0x00, 0x00, 0x06, 0xfc, 0x9f, 0xa0, 0x00, 0x00, 0x6f, 0xc9, 0xfa, 0x00, 0x00, 0x06, 0xfc, 0x8f, 0xa0, 0x00, 0x00, 0x7f, 0xc7, 0xfc, 0x00, 0x00, 0x09, 0xfa, 0x2e, 0xe6, 0x00, 0x03, 0xdf, 0x70, 0x9f, 0xec, 0xab, 0xef, 0xb0, 0x00, 0x8d, 0xff, 0xfe, 0xa1, 0x00, 0x00, 0x04, 0x54, 0x10, 0x00, 0xcd, 0x40, 0x00, 0x00, 0x3d, 0xd0, 0xaf, 0x90, 0x00, 0x00, 0x9f, 0xb0, 0x5f, 0xd0, 0x00, 0x00, 0xcf, 0x60, 0x0d, 0xf5, 0x00, 0x04, 0xed, 0x00, 0x09, 0xfa, 0x00, 0x09, 0xfa, 0x00, 0x04, 0xed, 0x00, 0x0d, 0xf5, 0x00, 0x00, 0xcf, 0x50, 0x4f, 0xd0, 0x00, 0x00, 0x9f, 0xa0, 0x9f, 0x90, 0x00, 0x00, 0x3e, 0xd0, 0xdf, 0x40, 0x00, 0x00, 0x0c, 0xf7, 0xfd, 0x00, 0x00, 0x00, 0x08, 0xfc, 0xf9, 0x00, 0x00, 0x00, 0x02, 0xef, 0xe3, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xc0, 0x00, 0x00, 0xbd, 0x60, 0x00, 0x0b, 0xd9, 0x00, 0x00, 0x7d, 0xaa, 0xf9, 0x00, 0x01, 0xef, 0xd0, 0x00, 0x0a, 0xf9, 0x6f, 0xc0, 0x00, 0x6f, 0xee, 0x30, 0x00, 0xdf, 0x51, 0xee, 0x10, 0x0a, 0xfa, 0xf8, 0x00, 0x3e, 0xd0, 0x0c, 0xf6, 0x00, 0xde, 0x4f, 0xb0, 0x07, 0xfb, 0x00, 0x9f, 0x90, 0x3e, 0xc0, 0xde, 0x10, 0xaf, 0x80, 0x05, 0xfc, 0x08, 0xf9, 0x0a, 0xf6, 0x0d, 0xf4, 0x00, 0x0e, 0xe1, 0xbf, 0x40, 0x7f, 0xa2, 0xed, 0x00, 0x00, 0xbf, 0x6e, 0xd0, 0x01, 0xed, 0x7f, 0xa0, 0x00, 0x09, 0xfa, 0xfa, 0x00, 0x0c, 0xea, 0xf7, 0x00, 0x00, 0x4f, 0xdf, 0x70, 0x00, 0x8f, 0xde, 0x30, 0x00, 0x00, 0xdf, 0xe2, 0x00, 0x04, 0xff, 0xd0, 0x00, 0x00, 0x0b, 0xfc, 0x00, 0x00, 0x0d, 0xfa, 0x00, 0x00, 0x8d, 0xb0, 0x00, 0x00, 0xbd, 0x71, 0xdf, 0x80, 0x00, 0x8f, 0xc0, 0x05, 0xee, 0x20, 0x2e, 0xe5, 0x00, 0x0a, 0xfb, 0x0b, 0xf9, 0x00, 0x00, 0x1d, 0xe9, 0xed, 0x10, 0x00, 0x00, 0x6e, 0xfe, 0x50, 0x00, 0x00, 0x01, 0xdf, 0xd0, 0x00, 0x00, 0x00, 0x9f, 0xef, 0x80, 0x00, 0x00, 0x4e, 0xe5, 0xee, 0x30, 0x00, 0x0c, 0xf8, 0x09, 0xfb, 0x00, 0x08, 0xfc, 0x00, 0x1d, 0xf7, 0x03, 0xee, 0x40, 0x00, 0x6e, 0xe2, 0xbf, 0xa0, 0x00, 0x00, 0xbf, 0xb0, 0xbd, 0x70, 0x00, 0x00, 0xcd, 0x67, 0xfd, 0x00, 0x00, 0x7f, 0xc0, 0x0c, 0xf8, 0x00, 0x1d, 0xf6, 0x00, 0x6e, 0xd1, 0x08, 0xfc, 0x00, 0x00, 0xbf, 0x81, 0xde, 0x50, 0x00, 0x04, 0xed, 0x9f, 0xb0, 0x00, 0x00, 0x0b, 0xfe, 0xe3, 0x00, 0x00, 0x00, 0x3e, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x60, 0x00, 0x00, 0x00, 0x0c, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x60, 0x00, 0x00, 0x00, 0x0c, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x60, 0x00, 0x00, 0x5d, 0xdd, 0xdd, 0xdd, 0xd9, 0x5d, 0xdd, 0xdd, 0xde, 0xf9, 0x00, 0x00, 0x00, 0x7e, 0xd2, 0x00, 0x00, 0x02, 0xde, 0x60, 0x00, 0x00, 0x0b, 0xfa, 0x00, 0x00, 0x00, 0x7f, 0xd2, 0x00, 0x00, 0x03, 0xee, 0x60, 0x00, 0x00, 0x0b, 0xfa, 0x00, 0x00, 0x00, 0x7f, 0xd1, 0x00, 0x00, 0x03, 0xee, 0x60, 0x00, 0x00, 0x0b, 0xfa, 0x00, 0x00, 0x00, 0x7f, 0xfc, 0xcc, 0xcc, 0xc9, 0x8f, 0xff, 0xff, 0xff, 0xfc, 0xad, 0xdd, 0x9b, 0xfc, 0xb7, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0x50, 0x0b, 0xf5, 0x00, 0xbf, 0xcb, 0x7a, 0xdd, 0xd9, 0xbe, 0x40, 0x00, 0x08, 0xfa, 0x00, 0x00, 0x2e, 0xd0, 0x00, 0x00, 0xbf, 0x60, 0x00, 0x06, 0xfb, 0x00, 0x00, 0x0d, 0xe2, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x04, 0xec, 0x00, 0x00, 0x0c, 0xe4, 0x00, 0x00, 0x8f, 0x90, 0x00, 0x02, 0xed, 0x00, 0x00, 0x0b, 0xf6, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x00, 0x21, 0x9d, 0xdd, 0x98, 0xbc, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x00, 0x6f, 0xa0, 0x06, 0xfa, 0x8b, 0xcf, 0xa9, 0xdd, 0xd9, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x06, 0xfe, 0x50, 0x00, 0x00, 0x0c, 0xcd, 0xc0, 0x00, 0x00, 0x5e, 0x77, 0xf6, 0x00, 0x00, 0xbd, 0x10, 0xdc, 0x00, 0x04, 0xe9, 0x00, 0x7f, 0x60, 0x0a, 0xe2, 0x00, 0x0d, 0xc0, 0x3e, 0xa0, 0x00, 0x07, 0xf7, 0x37, 0x30, 0x00, 0x00, 0x75, 0x18, 0x88, 0x88, 0x88, 0x71, 0xdd, 0xdd, 0xdd, 0xdc, 0x4c, 0xd5, 0x00, 0x7e, 0xc1, 0x00, 0x7e, 0xa0, 0x00, 0x23, 0x01, 0x7b, 0xcd, 0xc8, 0x00, 0x1e, 0xec, 0xbe, 0xf8, 0x00, 0x51, 0x00, 0x6f, 0xc0, 0x00, 0x00, 0x01, 0xed, 0x00, 0x7b, 0xdd, 0xef, 0xe0, 0xbf, 0xda, 0x98, 0xfe, 0x4e, 0xe3, 0x00, 0x2f, 0xe5, 0xfd, 0x00, 0x08, 0xfe, 0x2e, 0xfa, 0x8a, 0xee, 0xe0, 0x7e, 0xff, 0xd7, 0xbe, 0x00, 0x15, 0x41, 0x00, 0x00, 0x8c, 0x70, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0xaf, 0x89, 0xdd, 0xc5, 0x00, 0xaf, 0xde, 0xcd, 0xfe, 0x60, 0xaf, 0xe4, 0x00, 0xaf, 0xc0, 0xaf, 0xa0, 0x00, 0x2e, 0xe2, 0xaf, 0x90, 0x00, 0x0d, 0xf5, 0xaf, 0x90, 0x00, 0x0d, 0xf5, 0xaf, 0xa0, 0x00, 0x0e, 0xf3, 0xaf, 0xd1, 0x00, 0x7f, 0xd0, 0xaf, 0xed, 0x9a, 0xef, 0x80, 0xae, 0x5c, 0xff, 0xe9, 0x00, 0x00, 0x00, 0x45, 0x20, 0x00, 0x00, 0x29, 0xcd, 0xda, 0x30, 0x2d, 0xfe, 0xcd, 0xe2, 0x0a, 0xfc, 0x20, 0x03, 0x00, 0xdf, 0x50, 0x00, 0x00, 0x0e, 0xe0, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x0e, 0xf3, 0x00, 0x00, 0x00, 0xbf, 0x90, 0x00, 0x00, 0x05, 0xee, 0xb9, 0xad, 0x30, 0x06, 0xdf, 0xff, 0xd2, 0x00, 0x00, 0x35, 0x40, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc9, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x4b, 0xdd, 0xa6, 0xfc, 0x04, 0xef, 0xdc, 0xed, 0xfc, 0x0b, 0xfc, 0x10, 0x3d, 0xfc, 0x0e, 0xf5, 0x00, 0x08, 0xfc, 0x1f, 0xe1, 0x00, 0x06, 0xfc, 0x1f, 0xe0, 0x00, 0x05, 0xfc, 0x0e, 0xf3, 0x00, 0x07, 0xfc, 0x0c, 0xf9, 0x00, 0x0b, 0xfc, 0x07, 0xee, 0xb9, 0xce, 0xfc, 0x00, 0x8e, 0xff, 0xd5, 0xec, 0x00, 0x01, 0x53, 0x00, 0x00, 0x00, 0x2a, 0xdd, 0xc7, 0x00, 0x02, 0xdf, 0xdb, 0xdf, 0x90, 0x09, 0xfb, 0x00, 0x3e, 0xe3, 0x0d, 0xf4, 0x00, 0x0b, 0xf8, 0x0e, 0xed, 0xdd, 0xde, 0xf9, 0x1e, 0xea, 0xaa, 0xaa, 0xa6, 0x0e, 0xf3, 0x00, 0x00, 0x00, 0x0b, 0xfa, 0x00, 0x00, 0x00, 0x04, 0xef, 0xc9, 0x9b, 0xd0, 0x00, 0x5c, 0xef, 0xfe, 0xc0, 0x00, 0x00, 0x25, 0x52, 0x00, 0x00, 0x19, 0xcc, 0xb3, 0x00, 0xaf, 0xed, 0xd0, 0x00, 0xee, 0x40, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x5b, 0xfe, 0xcc, 0x50, 0xac, 0xfe, 0xcc, 0x50, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x03, 0xfd, 0x00, 0x00, 0x00, 0x4b, 0xdd, 0xa2, 0xba, 0x04, 0xef, 0xdc, 0xec, 0xfc, 0x0b, 0xfb, 0x00, 0x2d, 0xfc, 0x0d, 0xf5, 0x00, 0x08, 0xfc, 0x1f, 0xe0, 0x00, 0x05, 0xfc, 0x2f, 0xe0, 0x00, 0x05, 0xfc, 0x0e, 0xf3, 0x00, 0x06, 0xfc, 0x0c, 0xf9, 0x00, 0x0a, 0xfc, 0x06, 0xee, 0xa9, 0xbe, 0xfc, 0x00, 0x8e, 0xff, 0xd8, 0xfc, 0x00, 0x01, 0x54, 0x06, 0xfb, 0x00, 0x00, 0x00, 0x0a, 0xfa, 0x08, 0xc9, 0x77, 0xae, 0xe5, 0x07, 0xef, 0xff, 0xfe, 0x70, 0x00, 0x15, 0x77, 0x50, 0x00, 0x8c, 0x70, 0x00, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x00, 0xaf, 0x88, 0xcd, 0xc8, 0x0a, 0xfc, 0xec, 0xce, 0xf8, 0xaf, 0xe5, 0x00, 0x9f, 0xca, 0xfb, 0x00, 0x03, 0xfd, 0xaf, 0x90, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0xaf, 0x80, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0xaf, 0x80, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0x37, 0x2b, 0xf9, 0x7c, 0x60, 0x00, 0x8c, 0x7a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0x00, 0x37, 0x20, 0x0b, 0xf9, 0x00, 0x7c, 0x60, 0x00, 0x00, 0x00, 0x8c, 0x70, 0x0a, 0xf8, 0x00, 0xaf, 0x80, 0x0a, 0xf8, 0x00, 0xaf, 0x80, 0x0a, 0xf8, 0x00, 0xaf, 0x80, 0x0a, 0xf8, 0x00, 0xaf, 0x80, 0x0a, 0xf8, 0x00, 0xaf, 0x80, 0x0a, 0xf8, 0x77, 0xef, 0x6e, 0xff, 0xb0, 0x67, 0x50, 0x00, 0x8c, 0x70, 0x00, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x01, 0xac, 0x6a, 0xf8, 0x00, 0xbf, 0xa0, 0xaf, 0x80, 0xaf, 0xb0, 0x0a, 0xf8, 0xaf, 0xc1, 0x00, 0xaf, 0xbf, 0xe2, 0x00, 0x0a, 0xff, 0xef, 0xb0, 0x00, 0xaf, 0xb2, 0xdf, 0x70, 0x0a, 0xf8, 0x05, 0xee, 0x40, 0xaf, 0x80, 0x09, 0xfd, 0x1a, 0xf8, 0x00, 0x0b, 0xfb, 0x8c, 0x7a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0xaf, 0x8a, 0xf8, 0x8c, 0x29, 0xdd, 0xc5, 0x19, 0xdd, 0xc6, 0x0a, 0xfc, 0xec, 0xdf, 0xeb, 0xec, 0xdf, 0xe5, 0xaf, 0xe4, 0x01, 0xdf, 0xe5, 0x00, 0xbf, 0xaa, 0xfa, 0x00, 0x09, 0xfb, 0x00, 0x07, 0xfb, 0xaf, 0x90, 0x00, 0x9f, 0xa0, 0x00, 0x7f, 0xba, 0xf8, 0x00, 0x09, 0xfa, 0x00, 0x07, 0xfb, 0xaf, 0x80, 0x00, 0x9f, 0xa0, 0x00, 0x7f, 0xba, 0xf8, 0x00, 0x09, 0xfa, 0x00, 0x07, 0xfb, 0xaf, 0x80, 0x00, 0x9f, 0xa0, 0x00, 0x7f, 0xba, 0xf8, 0x00, 0x09, 0xfa, 0x00, 0x07, 0xfb, 0x8c, 0x28, 0xcd, 0xc8, 0x0a, 0xfc, 0xed, 0xce, 0xf8, 0xaf, 0xe5, 0x00, 0x9f, 0xca, 0xfb, 0x00, 0x03, 0xfd, 0xaf, 0x90, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0xaf, 0x80, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0xaf, 0x80, 0x00, 0x1f, 0xea, 0xf8, 0x00, 0x01, 0xfe, 0x00, 0x29, 0xcd, 0xc9, 0x10, 0x00, 0x2d, 0xfe, 0xcd, 0xfc, 0x10, 0x0a, 0xfc, 0x10, 0x1c, 0xf9, 0x00, 0xdf, 0x50, 0x00, 0x5f, 0xd0, 0x0e, 0xe0, 0x00, 0x00, 0xee, 0x11, 0xfe, 0x00, 0x00, 0x0e, 0xf2, 0x0e, 0xf3, 0x00, 0x03, 0xfe, 0x00, 0xbf, 0x90, 0x00, 0x9f, 0xb0, 0x04, 0xee, 0xb8, 0xbe, 0xe4, 0x00, 0x05, 0xcf, 0xff, 0xc5, 0x00, 0x00, 0x00, 0x35, 0x30, 0x00, 0x00, 0x8c, 0x38, 0xcd, 0xc6, 0x00, 0xaf, 0xce, 0xcd, 0xfe, 0x60, 0xaf, 0xe4, 0x00, 0xaf, 0xc0, 0xaf, 0xa0, 0x00, 0x2e, 0xe2, 0xaf, 0x90, 0x00, 0x0d, 0xf5, 0xaf, 0x90, 0x00, 0x0d, 0xf5, 0xaf, 0xa0, 0x00, 0x0e, 0xf3, 0xaf, 0xd1, 0x00, 0x7f, 0xd0, 0xaf, 0xec, 0x9a, 0xef, 0x80, 0xaf, 0x9c, 0xff, 0xe9, 0x00, 0xaf, 0x80, 0x35, 0x20, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x00, 0x00, 0x57, 0x40, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xdd, 0xa2, 0xba, 0x03, 0xef, 0xdc, 0xec, 0xfc, 0x0b, 0xfb, 0x10, 0x3d, 0xfc, 0x0d, 0xf5, 0x00, 0x08, 0xfc, 0x0e, 0xe1, 0x00, 0x06, 0xfc, 0x1f, 0xe0, 0x00, 0x05, 0xfc, 0x0e, 0xf3, 0x00, 0x07, 0xfc, 0x0c, 0xf9, 0x00, 0x0b, 0xfc, 0x07, 0xee, 0xa9, 0xbe, 0xfc, 0x00, 0x8e, 0xff, 0xd8, 0xfc, 0x00, 0x01, 0x54, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x03, 0x76, 0x8c, 0x17, 0xcd, 0x6a, 0xf9, 0xee, 0xe6, 0xaf, 0xfa, 0x10, 0x0a, 0xfc, 0x00, 0x00, 0xaf, 0x90, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0xaf, 0x80, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x02, 0x9c, 0xdd, 0xb6, 0x0c, 0xfc, 0xbc, 0xea, 0x3f, 0xd0, 0x00, 0x22, 0x1e, 0xe8, 0x10, 0x00, 0x08, 0xef, 0xea, 0x30, 0x00, 0x4a, 0xef, 0xe6, 0x00, 0x00, 0x2a, 0xfd, 0x00, 0x00, 0x00, 0xee, 0x4d, 0xa8, 0x8b, 0xfb, 0x2d, 0xef, 0xfe, 0xb3, 0x00, 0x35, 0x52, 0x00, 0x00, 0xba, 0x00, 0x00, 0x3e, 0xb0, 0x00, 0x5c, 0xfd, 0xcc, 0x6a, 0xdf, 0xec, 0xc7, 0x08, 0xfb, 0x00, 0x00, 0x8f, 0xb0, 0x00, 0x08, 0xfb, 0x00, 0x00, 0x8f, 0xb0, 0x00, 0x08, 0xfb, 0x00, 0x00, 0x7f, 0xb0, 0x00, 0x04, 0xee, 0x99, 0x60, 0x09, 0xef, 0xf8, 0x00, 0x02, 0x53, 0x00, 0x9c, 0x60, 0x00, 0x3c, 0xbb, 0xf7, 0x00, 0x04, 0xfd, 0xbf, 0x70, 0x00, 0x4f, 0xdb, 0xf7, 0x00, 0x04, 0xfd, 0xbf, 0x70, 0x00, 0x4f, 0xdb, 0xf7, 0x00, 0x04, 0xfd, 0xbf, 0x80, 0x00, 0x6f, 0xda, 0xfa, 0x00, 0x0a, 0xfd, 0x6f, 0xea, 0x9b, 0xee, 0xd0, 0x9e, 0xff, 0xd6, 0xdd, 0x00, 0x25, 0x40, 0x00, 0x00, 0xbc, 0x40, 0x00, 0x09, 0xc6, 0xaf, 0x90, 0x00, 0x2e, 0xe3, 0x5f, 0xd0, 0x00, 0x7f, 0xb0, 0x0d, 0xf5, 0x00, 0xbf, 0x70, 0x09, 0xfa, 0x02, 0xed, 0x00, 0x03, 0xed, 0x08, 0xfa, 0x00, 0x00, 0xbf, 0x5c, 0xe4, 0x00, 0x00, 0x7f, 0xae, 0xc0, 0x00, 0x00, 0x0d, 0xef, 0x80, 0x00, 0x00, 0x0a, 0xfe, 0x20, 0x00, 0xac, 0x50, 0x00, 0xbc, 0x70, 0x00, 0xac, 0x59, 0xf9, 0x00, 0x4f, 0xfc, 0x00, 0x0e, 0xe2, 0x6f, 0xc0, 0x09, 0xfc, 0xe1, 0x05, 0xfc, 0x00, 0xee, 0x10, 0xce, 0x8f, 0x60, 0x9f, 0x90, 0x0b, 0xf6, 0x2e, 0xb4, 0xfa, 0x0c, 0xf5, 0x00, 0x8f, 0x97, 0xf8, 0x0d, 0xd1, 0xed, 0x00, 0x04, 0xec, 0xbe, 0x30, 0xaf, 0x7f, 0xb0, 0x00, 0x0d, 0xed, 0xc0, 0x07, 0xfc, 0xf7, 0x00, 0x00, 0xaf, 0xe9, 0x00, 0x2e, 0xee, 0x20, 0x00, 0x07, 0xee, 0x50, 0x00, 0xce, 0xc0, 0x00, 0x6c, 0xa0, 0x00, 0x2c, 0xc3, 0x0c, 0xf8, 0x00, 0xbf, 0xa0, 0x04, 0xee, 0x47, 0xed, 0x10, 0x00, 0x8f, 0xcd, 0xe5, 0x00, 0x00, 0x0c, 0xff, 0x90, 0x00, 0x00, 0x0b, 0xff, 0x80, 0x00, 0x00, 0x7f, 0xce, 0xe4, 0x00, 0x03, 0xee, 0x47, 0xfc, 0x10, 0x0c, 0xf9, 0x00, 0xbf, 0x90, 0x9f, 0xc0, 0x00, 0x3e, 0xe6, 0xbc, 0x40, 0x00, 0x09, 0xc7, 0xaf, 0xa0, 0x00, 0x1e, 0xe3, 0x4e, 0xd0, 0x00, 0x7f, 0xc0, 0x0c, 0xf6, 0x00, 0xbf, 0x70, 0x07, 0xfb, 0x02, 0xee, 0x10, 0x01, 0xee, 0x18, 0xfa, 0x00, 0x00, 0xaf, 0x7c, 0xf5, 0x00, 0x00, 0x4e, 0xbe, 0xd0, 0x00, 0x00, 0x0c, 0xef, 0x90, 0x00, 0x00, 0x07, 0xfe, 0x30, 0x00, 0x00, 0x07, 0xfb,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_18_light.rs
frostsnap_fonts/src/noto_sans_mono_18_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 18px //! Weight: 300 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_18_LIGHT_DATA: &[u8] = &[ 0x5d, 0x16, 0xf1, 0x5e, 0x05, 0xe0, 0x5e, 0x04, 0xe0, 0x4e, 0x03, 0xe0, 0x3e, 0x02, 0xa0, 0x00, 0x04, 0xa2, 0x8f, 0x40, 0x40, 0xa8, 0x0a, 0x8b, 0x90, 0xb8, 0xa8, 0x0a, 0x8a, 0x70, 0xa7, 0x86, 0x08, 0x60, 0x00, 0x02, 0xc0, 0x09, 0x60, 0x00, 0x05, 0xc0, 0x0c, 0x40, 0x00, 0x08, 0xa0, 0x0d, 0x00, 0x00, 0x0a, 0x80, 0x3d, 0x00, 0x0d, 0xde, 0xdd, 0xde, 0xdc, 0x00, 0x0d, 0x10, 0x99, 0x00, 0x00, 0x2d, 0x00, 0xb7, 0x00, 0x00, 0x6b, 0x00, 0xc3, 0x00, 0x9d, 0xde, 0xdd, 0xed, 0xd5, 0x22, 0xb8, 0x25, 0xc2, 0x21, 0x00, 0xc4, 0x07, 0xb0, 0x00, 0x00, 0xd0, 0x09, 0x90, 0x00, 0x03, 0xd0, 0x0b, 0x60, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x04, 0x8d, 0x85, 0x00, 0x0a, 0xeb, 0xdb, 0xda, 0x05, 0xd3, 0x3c, 0x00, 0x10, 0x8b, 0x03, 0xc0, 0x00, 0x06, 0xd2, 0x3c, 0x00, 0x00, 0x0b, 0xd9, 0xc0, 0x00, 0x00, 0x06, 0xce, 0xb5, 0x00, 0x00, 0x03, 0xd9, 0xe9, 0x00, 0x00, 0x3c, 0x04, 0xe3, 0x00, 0x03, 0xc0, 0x0d, 0x50, 0x00, 0x3c, 0x05, 0xe1, 0x7d, 0xba, 0xdb, 0xd7, 0x00, 0x58, 0xad, 0x72, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x4c, 0xcc, 0x40, 0x04, 0xc1, 0x0c, 0x70, 0x6c, 0x00, 0xa9, 0x00, 0xe0, 0x00, 0xd1, 0x4d, 0x10, 0x0e, 0x00, 0x0d, 0x1b, 0x80, 0x00, 0xc6, 0x05, 0xd4, 0xd1, 0x00, 0x05, 0xcc, 0xd6, 0xb8, 0x00, 0x00, 0x00, 0x30, 0x4d, 0x10, 0x00, 0x00, 0x00, 0x0b, 0x86, 0xcc, 0xa1, 0x00, 0x04, 0xd2, 0xd4, 0x0a, 0x90, 0x00, 0xb8, 0x5c, 0x00, 0x5c, 0x00, 0x5d, 0x06, 0xc0, 0x05, 0xc0, 0x0b, 0x80, 0x2d, 0x20, 0x9a, 0x05, 0xd0, 0x00, 0x8d, 0xbc, 0x30, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xcd, 0xd7, 0x00, 0x00, 0x0a, 0xa0, 0x4e, 0x20, 0x00, 0x0c, 0x60, 0x0d, 0x50, 0x00, 0x0b, 0x80, 0x2e, 0x20, 0x00, 0x06, 0xc1, 0xba, 0x00, 0x00, 0x00, 0xcf, 0xb0, 0x00, 0x00, 0x06, 0xef, 0x60, 0x00, 0x00, 0x4d, 0x66, 0xd3, 0x07, 0xc0, 0xb9, 0x00, 0x9c, 0x1a, 0x90, 0xd5, 0x00, 0x0b, 0xbe, 0x40, 0xd6, 0x00, 0x02, 0xfe, 0x00, 0xac, 0x20, 0x1a, 0xee, 0x50, 0x2b, 0xec, 0xea, 0x28, 0xd2, 0x00, 0x35, 0x20, 0x00, 0x00, 0x4d, 0x4e, 0x2d, 0x0d, 0x0a, 0x00, 0x1c, 0x50, 0x0a, 0xa0, 0x03, 0xe3, 0x00, 0x9b, 0x00, 0x0c, 0x70, 0x01, 0xe3, 0x00, 0x3e, 0x00, 0x05, 0xd0, 0x00, 0x5d, 0x00, 0x04, 0xe0, 0x00, 0x1e, 0x30, 0x00, 0xc7, 0x00, 0x09, 0xb0, 0x00, 0x3e, 0x30, 0x00, 0xaa, 0x00, 0x01, 0xc4, 0x7b, 0x00, 0x0c, 0x70, 0x06, 0xd0, 0x00, 0xd6, 0x00, 0xaa, 0x00, 0x7c, 0x00, 0x5e, 0x00, 0x3e, 0x00, 0x3e, 0x00, 0x5d, 0x00, 0x7c, 0x00, 0xaa, 0x00, 0xd6, 0x06, 0xd0, 0x0c, 0x70, 0x7a, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x0d, 0x20, 0x00, 0x01, 0x00, 0xd0, 0x01, 0x13, 0xeb, 0x8c, 0x7b, 0xe7, 0x01, 0x6a, 0xeb, 0x72, 0x00, 0x00, 0xc8, 0xd3, 0x00, 0x00, 0xab, 0x09, 0xc1, 0x00, 0x0a, 0x30, 0x1a, 0x30, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0xad, 0xdd, 0xed, 0xdd, 0x82, 0x33, 0x3d, 0x33, 0x32, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x05, 0x31, 0xe7, 0x5e, 0x29, 0xc0, 0xb8, 0x08, 0x20, 0x49, 0x99, 0x99, 0x25, 0xaa, 0xaa, 0xa2, 0x4a, 0x28, 0xf4, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x50, 0x00, 0x05, 0xd0, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x1e, 0x40, 0x00, 0x08, 0xc0, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x4e, 0x10, 0x00, 0x09, 0xa0, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x02, 0xe3, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x1a, 0xee, 0xd8, 0x00, 0x0a, 0xc3, 0x05, 0xe8, 0x03, 0xe3, 0x00, 0x1f, 0xe0, 0x8b, 0x00, 0x09, 0xbd, 0x5a, 0x90, 0x03, 0xe4, 0xb8, 0xb8, 0x00, 0xb9, 0x0a, 0x9b, 0x80, 0x6d, 0x10, 0xa9, 0xb8, 0x0d, 0x70, 0x0a, 0x9a, 0x98, 0xc0, 0x00, 0xb8, 0x8c, 0xd4, 0x00, 0x0d, 0x54, 0xfa, 0x00, 0x04, 0xe1, 0x0b, 0xb1, 0x02, 0xc9, 0x00, 0x2b, 0xed, 0xea, 0x00, 0x00, 0x02, 0x52, 0x00, 0x00, 0x00, 0x5c, 0x90, 0x00, 0x2a, 0xdc, 0xa0, 0x00, 0xbb, 0x29, 0xa0, 0x00, 0x10, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x00, 0x09, 0xa0, 0x00, 0x0c, 0xdf, 0xfd, 0xc2, 0x00, 0x00, 0x10, 0x00, 0x00, 0x6b, 0xee, 0xd9, 0x00, 0x4d, 0x82, 0x05, 0xd9, 0x00, 0x00, 0x00, 0x07, 0xd0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x5e, 0x40, 0x00, 0x00, 0x3d, 0x80, 0x00, 0x00, 0x3d, 0x90, 0x00, 0x00, 0x2d, 0x90, 0x00, 0x00, 0x2c, 0xa0, 0x00, 0x00, 0x2c, 0xa0, 0x00, 0x00, 0x08, 0xfe, 0xee, 0xee, 0xea, 0x00, 0x00, 0x10, 0x00, 0x00, 0x6c, 0xee, 0xea, 0x20, 0x4d, 0x82, 0x04, 0xcb, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x09, 0xc0, 0x00, 0x35, 0x6a, 0xd4, 0x00, 0x0a, 0xdd, 0xd9, 0x20, 0x00, 0x00, 0x03, 0xac, 0x10, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x01, 0xd7, 0x66, 0x00, 0x02, 0xbd, 0x16, 0xde, 0xdd, 0xeb, 0x30, 0x00, 0x25, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x07, 0xdd, 0x00, 0x00, 0x00, 0x2d, 0x7d, 0x00, 0x00, 0x00, 0xaa, 0x5d, 0x00, 0x00, 0x05, 0xd1, 0x5d, 0x00, 0x00, 0x1d, 0x60, 0x5d, 0x00, 0x00, 0x9b, 0x00, 0x5d, 0x00, 0x04, 0xd3, 0x00, 0x5d, 0x00, 0x0c, 0x94, 0x44, 0x6d, 0x43, 0x1d, 0xdd, 0xdd, 0xde, 0xdb, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x09, 0xdd, 0xdd, 0xd9, 0x00, 0xb9, 0x44, 0x44, 0x20, 0x0c, 0x70, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x40, 0x00, 0x00, 0x00, 0xeb, 0xcc, 0xb6, 0x00, 0x07, 0x75, 0x59, 0xe8, 0x00, 0x00, 0x00, 0x07, 0xe1, 0x00, 0x00, 0x00, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x5e, 0x25, 0x60, 0x00, 0x5d, 0xa0, 0x5d, 0xed, 0xde, 0x91, 0x00, 0x02, 0x54, 0x10, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x03, 0xad, 0xee, 0x80, 0x03, 0xda, 0x30, 0x01, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x4e, 0x10, 0x00, 0x00, 0x08, 0xb0, 0x00, 0x00, 0x00, 0xa9, 0x7d, 0xde, 0xb3, 0x0b, 0xca, 0x20, 0x1a, 0xd1, 0xbc, 0x00, 0x00, 0x0d, 0x7b, 0x90, 0x00, 0x00, 0xb9, 0x9a, 0x00, 0x00, 0x0b, 0x94, 0xd2, 0x00, 0x00, 0xd6, 0x0b, 0xb2, 0x00, 0xad, 0x00, 0x2b, 0xec, 0xec, 0x30, 0x00, 0x02, 0x53, 0x00, 0x00, 0x7d, 0xdd, 0xdd, 0xdd, 0x82, 0x44, 0x44, 0x44, 0xd6, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x03, 0xe3, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x07, 0xd0, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x00, 0x0a, 0xb0, 0x00, 0x00, 0x01, 0xe6, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x4b, 0xee, 0xd9, 0x00, 0x1d, 0x91, 0x04, 0xd8, 0x06, 0xd0, 0x00, 0x08, 0xc0, 0x6d, 0x00, 0x00, 0x7c, 0x01, 0xd8, 0x00, 0x2d, 0x70, 0x04, 0xdb, 0x9d, 0x80, 0x00, 0x19, 0xdd, 0xc4, 0x00, 0x2c, 0xa2, 0x07, 0xd7, 0x09, 0xb0, 0x00, 0x05, 0xe2, 0xc8, 0x00, 0x00, 0x0d, 0x5b, 0x90, 0x00, 0x01, 0xe4, 0x6e, 0x50, 0x02, 0xbc, 0x00, 0x8d, 0xdc, 0xeb, 0x20, 0x00, 0x04, 0x52, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x4c, 0xed, 0xd7, 0x00, 0x2d, 0x91, 0x05, 0xe7, 0x09, 0xb0, 0x00, 0x06, 0xd0, 0xb8, 0x00, 0x00, 0x0d, 0x5c, 0x80, 0x00, 0x00, 0xc8, 0xaa, 0x00, 0x00, 0x1d, 0x94, 0xe5, 0x00, 0x2b, 0xd8, 0x07, 0xdd, 0xcd, 0x7c, 0x70, 0x00, 0x43, 0x00, 0xd5, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x2a, 0xd1, 0x00, 0xbc, 0xde, 0xb3, 0x00, 0x02, 0x55, 0x20, 0x00, 0x00, 0x5b, 0x27, 0xe4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x18, 0xf4, 0x04, 0x00, 0x0a, 0x51, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x4f, 0x67, 0xe1, 0xab, 0x0c, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0x60, 0x00, 0x00, 0x7d, 0xb4, 0x00, 0x07, 0xcb, 0x40, 0x00, 0x6c, 0xb4, 0x00, 0x00, 0x9e, 0x60, 0x00, 0x00, 0x02, 0x9d, 0xa3, 0x00, 0x00, 0x00, 0x18, 0xdb, 0x40, 0x00, 0x00, 0x01, 0x8d, 0xb4, 0x00, 0x00, 0x00, 0x07, 0x60, 0x9b, 0xbb, 0xbb, 0xbb, 0x87, 0x88, 0x88, 0x88, 0x86, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x22, 0x21, 0xbe, 0xee, 0xee, 0xee, 0xa0, 0x86, 0x00, 0x00, 0x00, 0x05, 0xcc, 0x50, 0x00, 0x00, 0x00, 0x6c, 0xc5, 0x00, 0x00, 0x00, 0x06, 0xcb, 0x50, 0x00, 0x00, 0x00, 0x8e, 0x70, 0x00, 0x05, 0xbd, 0x81, 0x00, 0x5b, 0xc7, 0x00, 0x05, 0xcc, 0x70, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x09, 0xde, 0xed, 0x90, 0x85, 0x10, 0x5d, 0x80, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x8d, 0x20, 0x00, 0xac, 0x30, 0x00, 0x8c, 0x10, 0x00, 0x0c, 0x60, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x1e, 0x90, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x07, 0xcd, 0xc9, 0x20, 0x00, 0x0b, 0xc6, 0x13, 0x9c, 0x30, 0x09, 0xb0, 0x00, 0x00, 0x8b, 0x02, 0xd3, 0x02, 0x66, 0x20, 0xd3, 0x7b, 0x04, 0xda, 0xbc, 0x0a, 0x7a, 0x80, 0xc7, 0x06, 0xc0, 0x89, 0xb6, 0x2e, 0x00, 0x7b, 0x08, 0xac, 0x54, 0xd0, 0x08, 0xb0, 0x89, 0xc6, 0x3d, 0x00, 0xab, 0x09, 0x8b, 0x70, 0xd5, 0x2c, 0xc0, 0xc3, 0x8a, 0x07, 0xdd, 0x7a, 0xd9, 0x03, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x09, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x09, 0xd9, 0x77, 0x9c, 0x00, 0x00, 0x04, 0x9a, 0xa8, 0x30, 0x00, 0x00, 0x00, 0x7e, 0x30, 0x00, 0x00, 0x00, 0x0b, 0xd9, 0x00, 0x00, 0x00, 0x02, 0xe7, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x0d, 0x40, 0x00, 0x00, 0x0c, 0x80, 0xa9, 0x00, 0x00, 0x02, 0xe2, 0x06, 0xd0, 0x00, 0x00, 0x8b, 0x00, 0x0d, 0x50, 0x00, 0x0c, 0xc8, 0x88, 0xda, 0x00, 0x03, 0xfb, 0xbb, 0xbc, 0xe0, 0x00, 0x9b, 0x00, 0x00, 0x0d, 0x60, 0x0c, 0x70, 0x00, 0x00, 0xaa, 0x04, 0xe1, 0x00, 0x00, 0x05, 0xe1, 0x9b, 0x00, 0x00, 0x00, 0x0d, 0x70, 0x4d, 0xdd, 0xdc, 0xa3, 0x04, 0xe3, 0x34, 0x6b, 0xd2, 0x4e, 0x00, 0x00, 0x0d, 0x74, 0xe0, 0x00, 0x00, 0xc8, 0x4e, 0x00, 0x00, 0x2d, 0x54, 0xe6, 0x66, 0x8c, 0x90, 0x4e, 0xcc, 0xcd, 0xc6, 0x04, 0xe0, 0x00, 0x05, 0xd6, 0x4e, 0x00, 0x00, 0x09, 0xb4, 0xe0, 0x00, 0x00, 0x8c, 0x4e, 0x00, 0x00, 0x0b, 0xb4, 0xe0, 0x00, 0x39, 0xe4, 0x4e, 0xee, 0xee, 0xb5, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xbe, 0xee, 0xd9, 0x05, 0xea, 0x40, 0x16, 0x70, 0xd9, 0x00, 0x00, 0x00, 0x7d, 0x10, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x0c, 0x70, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x07, 0xe8, 0x10, 0x03, 0x50, 0x07, 0xde, 0xde, 0xe8, 0x00, 0x00, 0x25, 0x41, 0x00, 0x9d, 0xdd, 0xc9, 0x30, 0x0a, 0xa3, 0x46, 0xbe, 0x60, 0xaa, 0x00, 0x00, 0x8d, 0x2a, 0xa0, 0x00, 0x00, 0xc9, 0xaa, 0x00, 0x00, 0x09, 0xca, 0xa0, 0x00, 0x00, 0x7d, 0xaa, 0x00, 0x00, 0x05, 0xda, 0xa0, 0x00, 0x00, 0x6d, 0xaa, 0x00, 0x00, 0x08, 0xca, 0xa0, 0x00, 0x00, 0xc8, 0xaa, 0x00, 0x00, 0x7d, 0x2a, 0xa0, 0x04, 0xae, 0x60, 0xae, 0xee, 0xda, 0x40, 0x00, 0x4d, 0xdd, 0xdd, 0xdd, 0x54, 0xe4, 0x44, 0x44, 0x41, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe6, 0x66, 0x66, 0x50, 0x4e, 0xcc, 0xcc, 0xcb, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4f, 0xee, 0xee, 0xee, 0x60, 0x4d, 0xdd, 0xdd, 0xdd, 0x54, 0xe4, 0x44, 0x44, 0x41, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0xbb, 0xbb, 0xba, 0x04, 0xe8, 0x88, 0x88, 0x70, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0xce, 0xed, 0xa2, 0x00, 0x9d, 0x71, 0x04, 0x90, 0x05, 0xe4, 0x00, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x05, 0xaa, 0xa5, 0x2f, 0x10, 0x04, 0x99, 0xd7, 0x0e, 0x40, 0x00, 0x00, 0xc7, 0x0c, 0x80, 0x00, 0x00, 0xc7, 0x08, 0xd1, 0x00, 0x00, 0xc7, 0x01, 0xcb, 0x30, 0x02, 0xc7, 0x00, 0x2b, 0xed, 0xde, 0xc5, 0x00, 0x00, 0x14, 0x41, 0x00, 0x99, 0x00, 0x00, 0x0b, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xb6, 0x66, 0x66, 0xd7, 0xad, 0xcc, 0xcc, 0xce, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x70, 0x9d, 0xdd, 0xdd, 0x70, 0x04, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x9d, 0xde, 0xdd, 0x70, 0x00, 0x00, 0x03, 0xd0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x06, 0xd0, 0x60, 0x01, 0xca, 0x1d, 0xec, 0xec, 0x20, 0x03, 0x54, 0x00, 0x99, 0x00, 0x00, 0x3c, 0x7a, 0xa0, 0x00, 0x1c, 0xa0, 0xaa, 0x00, 0x0b, 0xc0, 0x0a, 0xa0, 0x0a, 0xd2, 0x00, 0xaa, 0x08, 0xd4, 0x00, 0x0a, 0xa6, 0xe5, 0x00, 0x00, 0xab, 0xdd, 0x90, 0x00, 0x0a, 0xe7, 0x4e, 0x50, 0x00, 0xaa, 0x00, 0x8d, 0x10, 0x0a, 0xa0, 0x00, 0xc9, 0x00, 0xaa, 0x00, 0x04, 0xe5, 0x0a, 0xa0, 0x00, 0x08, 0xd1, 0xaa, 0x00, 0x00, 0x0c, 0x90, 0xa8, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xbe, 0xee, 0xee, 0xe6, 0x1d, 0xa0, 0x00, 0x00, 0xcc, 0x1e, 0xe1, 0x00, 0x05, 0xed, 0x1e, 0xb7, 0x00, 0x0a, 0xbd, 0x1e, 0x7b, 0x00, 0x0d, 0x7d, 0x1e, 0x1e, 0x20, 0x6c, 0x5d, 0x1e, 0x0b, 0x80, 0xb8, 0x5d, 0x1e, 0x06, 0xc2, 0xe2, 0x5d, 0x1e, 0x00, 0xd9, 0xb0, 0x5d, 0x1e, 0x00, 0xae, 0x70, 0x5d, 0x1e, 0x00, 0x4a, 0x10, 0x5d, 0x1e, 0x00, 0x00, 0x00, 0x5d, 0x1e, 0x00, 0x00, 0x00, 0x5d, 0x1e, 0x00, 0x00, 0x00, 0x5d, 0x9d, 0x20, 0x00, 0x0b, 0x7a, 0xe9, 0x00, 0x00, 0xc7, 0xaa, 0xd2, 0x00, 0x0c, 0x7a, 0x9a, 0x90, 0x00, 0xc7, 0xaa, 0x4d, 0x20, 0x0c, 0x7a, 0xa0, 0xb9, 0x00, 0xc7, 0xaa, 0x04, 0xd1, 0x0c, 0x7a, 0xa0, 0x0b, 0x90, 0xc7, 0xaa, 0x00, 0x4d, 0x1c, 0x7a, 0xa0, 0x00, 0xb8, 0xc7, 0xaa, 0x00, 0x05, 0xdc, 0x7a, 0xa0, 0x00, 0x0b, 0xe7, 0xaa, 0x00, 0x00, 0x5e, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0xee, 0xea, 0x10, 0x01, 0xcb, 0x30, 0x4c, 0xb0, 0x08, 0xd1, 0x00, 0x02, 0xe5, 0x0c, 0x80, 0x00, 0x00, 0xaa, 0x0e, 0x50, 0x00, 0x00, 0x8c, 0x1f, 0x10, 0x00, 0x00, 0x6d, 0x3e, 0x00, 0x00, 0x00, 0x5e, 0x1e, 0x10, 0x00, 0x00, 0x6d, 0x0e, 0x40, 0x00, 0x00, 0x7c, 0x0c, 0x80, 0x00, 0x00, 0xaa, 0x09, 0xc0, 0x00, 0x01, 0xe6, 0x02, 0xda, 0x10, 0x2b, 0xb0, 0x00, 0x4c, 0xed, 0xeb, 0x20, 0x00, 0x00, 0x35, 0x20, 0x00, 0x4d, 0xdd, 0xdc, 0xa4, 0x04, 0xe3, 0x34, 0x6b, 0xe4, 0x4e, 0x00, 0x00, 0x0b, 0xa4, 0xe0, 0x00, 0x00, 0x8c, 0x4e, 0x00, 0x00, 0x08, 0xc4, 0xe0, 0x00, 0x00, 0xc9, 0x4e, 0x55, 0x57, 0xcc, 0x14, 0xed, 0xdc, 0xb8, 0x10, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0xee, 0xea, 0x10, 0x01, 0xcb, 0x30, 0x4c, 0xb0, 0x08, 0xd1, 0x00, 0x02, 0xe5, 0x0c, 0x80, 0x00, 0x00, 0xaa, 0x0e, 0x50, 0x00, 0x00, 0x8c, 0x1f, 0x10, 0x00, 0x00, 0x6d, 0x3e, 0x00, 0x00, 0x00, 0x5e, 0x1e, 0x10, 0x00, 0x00, 0x6d, 0x0e, 0x40, 0x00, 0x00, 0x7c, 0x0c, 0x80, 0x00, 0x00, 0xaa, 0x09, 0xc0, 0x00, 0x01, 0xe6, 0x02, 0xda, 0x10, 0x2b, 0xb0, 0x00, 0x4c, 0xed, 0xfe, 0x20, 0x00, 0x00, 0x35, 0x7d, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x05, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x42, 0x4d, 0xdd, 0xdc, 0x81, 0x00, 0x4e, 0x33, 0x57, 0xdc, 0x00, 0x4e, 0x00, 0x00, 0x3e, 0x60, 0x4e, 0x00, 0x00, 0x0c, 0x80, 0x4e, 0x00, 0x00, 0x0d, 0x70, 0x4e, 0x00, 0x00, 0x6e, 0x20, 0x4e, 0x99, 0x9b, 0xd6, 0x00, 0x4e, 0xaa, 0xae, 0x20, 0x00, 0x4e, 0x00, 0x0b, 0xa0, 0x00, 0x4e, 0x00, 0x04, 0xe4, 0x00, 0x4e, 0x00, 0x00, 0x9c, 0x00, 0x4e, 0x00, 0x00, 0x1d, 0x70, 0x4e, 0x00, 0x00, 0x07, 0xd2, 0x00, 0x00, 0x10, 0x00, 0x00, 0x2a, 0xde, 0xed, 0xa2, 0x0b, 0xc5, 0x10, 0x49, 0x03, 0xe2, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x02, 0xe6, 0x00, 0x00, 0x00, 0x08, 0xea, 0x40, 0x00, 0x00, 0x04, 0xbe, 0xb6, 0x00, 0x00, 0x00, 0x29, 0xeb, 0x00, 0x00, 0x00, 0x03, 0xd7, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x00, 0xc8, 0x55, 0x00, 0x01, 0x9e, 0x37, 0xde, 0xdc, 0xec, 0x50, 0x00, 0x24, 0x41, 0x00, 0x00, 0x4d, 0xdd, 0xdd, 0xdd, 0xdd, 0x14, 0x44, 0x6e, 0x44, 0x43, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x99, 0x00, 0x00, 0x0b, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x7a, 0xa0, 0x00, 0x00, 0xc7, 0xaa, 0x00, 0x00, 0x0c, 0x79, 0xb0, 0x00, 0x00, 0xd6, 0x6d, 0x00, 0x00, 0x3e, 0x21, 0xd9, 0x10, 0x2b, 0xb0, 0x04, 0xde, 0xde, 0xb2, 0x00, 0x00, 0x35, 0x20, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x2d, 0x32, 0xe4, 0x00, 0x00, 0x08, 0xc0, 0x0b, 0x90, 0x00, 0x00, 0xb9, 0x00, 0x7c, 0x00, 0x00, 0x2e, 0x40, 0x01, 0xe4, 0x00, 0x07, 0xd0, 0x00, 0x0b, 0x90, 0x00, 0xb9, 0x00, 0x00, 0x7c, 0x00, 0x1e, 0x40, 0x00, 0x01, 0xe3, 0x06, 0xd0, 0x00, 0x00, 0x0b, 0x80, 0xa9, 0x00, 0x00, 0x00, 0x7c, 0x0d, 0x40, 0x00, 0x00, 0x01, 0xe6, 0xd0, 0x00, 0x00, 0x00, 0x0b, 0xc9, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x40, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x0c, 0x46, 0xc0, 0x00, 0x00, 0x00, 0xe2, 0x4d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xe1, 0x04, 0xa0, 0x06, 0xd0, 0x0d, 0x50, 0x8e, 0x50, 0x8b, 0x00, 0xc7, 0x0b, 0xb9, 0x0a, 0xa0, 0x0a, 0x90, 0xd5, 0xb0, 0xb8, 0x00, 0x9a, 0x2c, 0x0d, 0x0c, 0x60, 0x07, 0xc7, 0xa0, 0xc4, 0xd4, 0x00, 0x4d, 0xa7, 0x0a, 0x8e, 0x00, 0x01, 0xdc, 0x30, 0x6b, 0xd0, 0x00, 0x0d, 0xc0, 0x02, 0xdc, 0x00, 0x00, 0xcb, 0x00, 0x0d, 0xb0, 0x00, 0x0a, 0x90, 0x00, 0x00, 0xa9, 0x00, 0x4e, 0x40, 0x00, 0x6d, 0x20, 0x00, 0x9b, 0x00, 0x0d, 0x70, 0x00, 0x01, 0xd6, 0x08, 0xc0, 0x00, 0x00, 0x06, 0xd3, 0xd4, 0x00, 0x00, 0x00, 0x0b, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x40, 0x00, 0x00, 0x00, 0x1d, 0xbb, 0x00, 0x00, 0x00, 0x09, 0xb0, 0xd7, 0x00, 0x00, 0x04, 0xd3, 0x05, 0xd2, 0x00, 0x00, 0xc9, 0x00, 0x0b, 0xa0, 0x00, 0x7d, 0x10, 0x00, 0x3e, 0x50, 0x2d, 0x60, 0x00, 0x00, 0x8c, 0x00, 0x2d, 0x40, 0x00, 0x00, 0x7c, 0x00, 0xab, 0x00, 0x00, 0x0c, 0x80, 0x03, 0xe4, 0x00, 0x07, 0xd0, 0x00, 0x09, 0xb0, 0x00, 0xc7, 0x00, 0x00, 0x2d, 0x40, 0x7c, 0x00, 0x00, 0x00, 0x9b, 0x0c, 0x60, 0x00, 0x00, 0x01, 0xd8, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x0b, 0xdd, 0xdd, 0xdc, 0x02, 0x33, 0x33, 0xab, 0x00, 0x00, 0x03, 0xe4, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x3e, 0x30, 0x00, 0x00, 0xba, 0x00, 0x00, 0x04, 0xe2, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x5e, 0x20, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x06, 0xd1, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x4f, 0xee, 0xee, 0xee, 0xbd, 0xdd, 0x4c, 0x71, 0x10, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x00, 0x0c, 0x70, 0x00, 0xc7, 0x22, 0x0b, 0xdd, 0xd4, 0x8a, 0x00, 0x00, 0x03, 0xe2, 0x00, 0x00, 0x0b, 0x80, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x01, 0xd4, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x08, 0xb0, 0x00, 0x00, 0x2e, 0x30, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x06, 0xd0, 0x00, 0x00, 0x0d, 0x50, 0x7d, 0xdd, 0x90, 0x11, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x00, 0x0a, 0xa0, 0x00, 0xaa, 0x12, 0x2a, 0xa7, 0xdd, 0xd9, 0x00, 0x05, 0xd2, 0x00, 0x00, 0x00, 0xcc, 0x90, 0x00, 0x00, 0x5c, 0x2d, 0x20, 0x00, 0x0c, 0x60, 0x99, 0x00, 0x05, 0xc0, 0x02, 0xd2, 0x00, 0xc6, 0x00, 0x09, 0x90, 0x6c, 0x00, 0x00, 0x2d, 0x2c, 0x70, 0x00, 0x00, 0x9a, 0x30, 0x00, 0x00, 0x01, 0x30, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x98, 0x88, 0x88, 0x88, 0x88, 0x87, 0x5c, 0x30, 0x09, 0xc0, 0x00, 0x9a, 0x00, 0x03, 0x03, 0x9b, 0xcb, 0x70, 0x0a, 0xa7, 0x58, 0xd8, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x48, 0xab, 0xbe, 0x1b, 0xd9, 0x76, 0x5e, 0x8c, 0x10, 0x00, 0x1e, 0xaa, 0x00, 0x00, 0x7f, 0x8c, 0x20, 0x05, 0xce, 0x1b, 0xec, 0xdc, 0x4e, 0x00, 0x25, 0x20, 0x00, 0x69, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x29, 0xcc, 0x81, 0x08, 0xcc, 0x95, 0x7c, 0xb0, 0x8e, 0x80, 0x00, 0x2e, 0x68, 0xe1, 0x00, 0x00, 0xba, 0x8c, 0x00, 0x00, 0x09, 0xb8, 0xc0, 0x00, 0x00, 0x9b, 0x8d, 0x00, 0x00, 0x0a, 0xa8, 0xe3, 0x00, 0x00, 0xd7, 0x8d, 0xb1, 0x00, 0x9d, 0x18, 0xa9, 0xdc, 0xdd, 0x40, 0x00, 0x02, 0x54, 0x00, 0x00, 0x00, 0x29, 0xbc, 0xb8, 0x00, 0x4d, 0xb7, 0x67, 0xa0, 0x0d, 0xa0, 0x00, 0x00, 0x05, 0xe1, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x08, 0xb0, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x03, 0xe4, 0x00, 0x00, 0x00, 0x0a, 0xd4, 0x00, 0x04, 0x00, 0x09, 0xed, 0xcd, 0xd0, 0x00, 0x01, 0x45, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x01, 0x9c, 0xc9, 0x1e, 0x51, 0xcc, 0x65, 0x9c, 0xd5, 0x8d, 0x10, 0x00, 0x9e, 0x5c, 0x90, 0x00, 0x04, 0xf5, 0xd6, 0x00, 0x00, 0x0e, 0x5d, 0x60, 0x00, 0x00, 0xe5, 0xd7, 0x00, 0x00, 0x2e, 0x5b, 0xb0, 0x00, 0x07, 0xf5, 0x5e, 0x70, 0x03, 0xce, 0x50, 0x7d, 0xdc, 0xd6, 0xc5, 0x00, 0x15, 0x40, 0x00, 0x00, 0x00, 0x6b, 0xcb, 0x70, 0x00, 0x9d, 0x85, 0x7c, 0xa0, 0x5e, 0x40, 0x00, 0x2e, 0x5a, 0xa0, 0x00, 0x00, 0xb9, 0xcc, 0xaa, 0xaa, 0xac, 0xac, 0xa8, 0x88, 0x88, 0x86, 0xb9, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x1d, 0xa2, 0x00, 0x05, 0x30, 0x3b, 0xed, 0xcd, 0xd4, 0x00, 0x01, 0x45, 0x20, 0x00, 0x00, 0x00, 0x4a, 0xcc, 0xb2, 0x00, 0x02, 0xea, 0x55, 0x70, 0x00, 0x07, 0xd0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x69, 0xac, 0xdb, 0xbb, 0x70, 0x58, 0x8b, 0xd8, 0x88, 0x50, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x01, 0x9c, 0xca, 0x29, 0x30, 0xcc, 0x65, 0x9c, 0xd5, 0x8d, 0x10, 0x00, 0x8f, 0x5c, 0x90, 0x00, 0x01, 0xe5, 0xd7, 0x00, 0x00, 0x0d, 0x5d, 0x60, 0x00, 0x00, 0xd5, 0xd8, 0x00, 0x00, 0x0e, 0x5a, 0xb0, 0x00, 0x05, 0xf5, 0x5e, 0x60, 0x03, 0xce, 0x50, 0x7d, 0xdc, 0xd7, 0xd5, 0x00, 0x04, 0x41, 0x0e, 0x40, 0x00, 0x00, 0x02, 0xe2, 0x31, 0x00, 0x00, 0xac, 0x07, 0xdb, 0xa9, 0xcd, 0x40, 0x03, 0x78, 0x86, 0x10, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x19, 0xcb, 0x81, 0x08, 0xcc, 0x95, 0x7d, 0xb0, 0x8e, 0x70, 0x00, 0x4e, 0x28, 0xd0, 0x00, 0x00, 0xd5, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x5f, 0x80, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xbb, 0xb5, 0x00, 0x01, 0x66, 0x7d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x07, 0xdd, 0xde, 0xed, 0xd9, 0x00, 0x00, 0x57, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x07, 0xbb, 0xb9, 0x04, 0x67, 0xad, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x8c, 0x00, 0x00, 0xba, 0xaa, 0xac, 0xd3, 0x58, 0x97, 0x10, 0xa5, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x97, 0x0d, 0x60, 0x00, 0xac, 0x10, 0xd6, 0x00, 0xac, 0x20, 0x0d, 0x60, 0x9d, 0x20, 0x00, 0xd6, 0x9e, 0x50, 0x00, 0x0d, 0xac, 0x9c, 0x00, 0x00, 0xdc, 0x20, 0xc9, 0x00, 0x0d, 0x60, 0x03, 0xe6, 0x00, 0xd6, 0x00, 0x07, 0xd3, 0x0d, 0x60, 0x00, 0x0a, 0xb0, 0x3c, 0xcc, 0xc5, 0x00, 0x01, 0x45, 0x5d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x07, 0xdd, 0xde, 0xed, 0xd9, 0x94, 0xbb, 0x36, 0xcb, 0x2d, 0xb6, 0xbb, 0xc6, 0xca, 0xe7, 0x05, 0xf6, 0x07, 0xce, 0x40, 0x2e, 0x10, 0x6d, 0xe2, 0x02, 0xe0, 0x05, 0xde, 0x20, 0x2e, 0x00, 0x5d, 0xe2, 0x02, 0xe0, 0x05, 0xde, 0x20, 0x2e, 0x00, 0x5d, 0xe2, 0x02, 0xe0, 0x05, 0xde, 0x20, 0x2e, 0x00, 0x5d, 0x57, 0x29, 0xcc, 0x91, 0x08, 0xbc, 0x95, 0x7c, 0xb0, 0x8e, 0x60, 0x00, 0x3e, 0x28, 0xd0, 0x00, 0x00, 0xd5, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x8c, 0x00, 0x00, 0x0d, 0x68, 0xc0, 0x00, 0x00, 0xd6, 0x00, 0x7b, 0xcb, 0x60, 0x00, 0xbc, 0x75, 0x8d, 0x90, 0x7d, 0x10, 0x00, 0x4e, 0x4b, 0x90, 0x00, 0x00, 0xb9, 0xd7, 0x00, 0x00, 0x09, 0xbd, 0x60, 0x00, 0x00, 0x9b, 0xc7, 0x00, 0x00, 0x0a, 0xaa, 0xb0, 0x00, 0x00, 0xd7, 0x3e, 0x80, 0x01, 0xac, 0x10, 0x5c, 0xdc, 0xdc, 0x30, 0x00, 0x03, 0x53, 0x00, 0x00, 0x57, 0x19, 0xcc, 0x81, 0x08, 0xbc, 0x85, 0x7c, 0xb0, 0x8e, 0x70, 0x00, 0x2d, 0x68, 0xe0, 0x00, 0x00, 0xaa, 0x8c, 0x00, 0x00, 0x09, 0xb8, 0xc0, 0x00, 0x00, 0x9b, 0x8d, 0x00, 0x00, 0x0a, 0xa8, 0xe4, 0x00, 0x00, 0xc7, 0x8d, 0xb1, 0x00, 0x8d, 0x18, 0xc8, 0xdc, 0xdd, 0x40, 0x8c, 0x00, 0x44, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9c, 0xc9, 0x19, 0x30, 0xcb, 0x65, 0x9c, 0xd5, 0x8d, 0x00, 0x00, 0x9f, 0x5b, 0x90, 0x00, 0x04, 0xf5, 0xd7, 0x00, 0x00, 0x0e, 0x5d, 0x60, 0x00, 0x00, 0xe5, 0xc8, 0x00, 0x00, 0x2f, 0x5a, 0xb0, 0x00, 0x07, 0xf5, 0x5e, 0x60, 0x03, 0xce, 0x50, 0x7e, 0xdc, 0xd5, 0xe5, 0x00, 0x15, 0x40, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x07, 0x20, 0x4b, 0xbb, 0x64, 0xac, 0xb3, 0x26, 0x7b, 0xad, 0x96, 0x82, 0x00, 0x0a, 0xe6, 0x00, 0x00, 0x00, 0x0a, 0xd0, 0x00, 0x00, 0x00, 0x0a, 0xb0, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x00, 0x9d, 0xde, 0xed, 0xda, 0x00, 0x07, 0xbc, 0xba, 0x58, 0xd8, 0x56, 0x96, 0xc8, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x3c, 0xd9, 0x30, 0x00, 0x05, 0xbe, 0xa2, 0x00, 0x00, 0x2c, 0xa0, 0x00, 0x00, 0x7c, 0x71, 0x00, 0x1b, 0xac, 0xed, 0xce, 0xc2, 0x01, 0x45, 0x20, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x0d, 0x50, 0x00, 0x08, 0xaa, 0xeb, 0xbb, 0xa0, 0x68, 0x8e, 0x98, 0x87, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0e, 0x50, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x03, 0xcd, 0xcd, 0x20, 0x00, 0x00, 0x45, 0x20, 0x68, 0x00, 0x00, 0x0a, 0x39, 0xb0, 0x00, 0x00, 0xe5, 0x9b, 0x00, 0x00, 0x0e, 0x59, 0xb0, 0x00, 0x00, 0xe5, 0x9b, 0x00, 0x00, 0x0e, 0x59, 0xb0, 0x00, 0x00, 0xe5, 0x9b, 0x00, 0x00, 0x1e, 0x57, 0xc0, 0x00, 0x06, 0xf5, 0x3e, 0x60, 0x03, 0xce, 0x50, 0x8e, 0xdc, 0xd6, 0xc5, 0x00, 0x14, 0x30, 0x00, 0x00, 0x96, 0x00, 0x00, 0x08, 0x79, 0xb0, 0x00, 0x00, 0xd6, 0x3e, 0x20, 0x00, 0x6d, 0x00, 0xc8, 0x00, 0x0b, 0x90, 0x07, 0xc0, 0x02, 0xe3, 0x00, 0x1e, 0x40, 0x8c, 0x00, 0x00, 0xaa, 0x0c, 0x70, 0x00, 0x05, 0xd3, 0xe1, 0x00, 0x00, 0x0d, 0xba, 0x00, 0x00, 0x00, 0x9f, 0x50, 0x00, 0x86, 0x00, 0x00, 0x00, 0x08, 0x69, 0xa0, 0x00, 0x00, 0x00, 0xc6, 0x6d, 0x00, 0x5d, 0x40, 0x0e, 0x21, 0xe1, 0x0a, 0xd8, 0x04, 0xd0, 0x0d, 0x50, 0xd8, 0xc0, 0x8b, 0x00, 0xb9, 0x4d, 0x1e, 0x2a, 0x90, 0x08, 0xb9, 0xa0, 0xb7, 0xc6, 0x00, 0x5c, 0xc6, 0x08, 0xbd, 0x20, 0x01, 0xdd, 0x10, 0x3d, 0xd0, 0x00, 0x0d, 0xb0, 0x00, 0xcb, 0x00, 0x69, 0x00, 0x00, 0x1a, 0x42, 0xd7, 0x00, 0x0a, 0xb0, 0x05, 0xe4, 0x07, 0xd2, 0x00, 0x08, 0xc3, 0xd6, 0x00, 0x00, 0x0b, 0xe9, 0x00, 0x00, 0x00, 0xae, 0x70, 0x00, 0x00, 0x7d, 0x6d, 0x40, 0x00, 0x3d, 0x50, 0x8c, 0x10, 0x0c, 0x90, 0x00, 0xba, 0x09, 0xc0, 0x00, 0x03, 0xd7, 0x86, 0x00, 0x00, 0x07, 0x78, 0xc0, 0x00, 0x00, 0xd6, 0x2e, 0x30, 0x00, 0x6d, 0x00, 0xa9, 0x00, 0x0a, 0x90, 0x05, 0xd0, 0x01, 0xe4, 0x00, 0x0c, 0x60, 0x7c, 0x00, 0x00, 0x8b, 0x0b, 0x80, 0x00, 0x02, 0xe3, 0xd2, 0x00, 0x00, 0x0b, 0xcb, 0x00, 0x00, 0x00, 0x5f, 0x60, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x3d, 0x30, 0x00, 0x08, 0xad, 0x90, 0x00, 0x00, 0x69, 0x60, 0x00, 0x00, 0x00, 0x09, 0xbb, 0xbb, 0xba, 0x06, 0x77, 0x77, 0xcb, 0x00, 0x00, 0x06, 0xd3, 0x00, 0x00, 0x3d, 0x60, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x09, 0xc1, 0x00, 0x00, 0x5d, 0x40, 0x00, 0x02, 0xd7, 0x00, 0x00, 0x0b, 0xa0, 0x00, 0x00, 0x4f, 0xee, 0xee, 0xed, 0x00, 0x04, 0xbd, 0x30, 0x01, 0xda, 0x30, 0x00, 0x4e, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x8c, 0x00, 0x04, 0xac, 0x60, 0x00, 0x4a, 0xd6, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x1d, 0x93, 0x00, 0x00, 0x4b, 0xd3, 0x2b, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x17, 0x6d, 0xa2, 0x00, 0x01, 0x4b, 0xb0, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x0e, 0x40, 0x00, 0x00, 0x8c, 0xa1, 0x00, 0x08, 0xca, 0x10, 0x00, 0xe4, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x05, 0xe0, 0x00, 0x14, 0xbb, 0x00, 0x06, 0xda, 0x20, 0x00, 0x04, 0x73, 0x00, 0x05, 0x43, 0xd9, 0xc7, 0x00, 0xb5, 0x89, 0x02, 0xc9, 0x6c, 0x08, 0x50, 0x02, 0x9b, 0x50, ]; /// Glyph metadata for binary search pub const NOTO_SANS_MONO_18_LIGHT_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 11, data_offset: 0, }, GlyphInfo { character: '!', width: 3, height: 14, x_offset: 4, y_offset: 1, x_advance: 11, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 5, x_offset: 3, y_offset: 1, x_advance: 11, data_offset: 21, }, GlyphInfo { character: '#', width: 10, height: 13, x_offset: 0, y_offset: 1, x_advance: 11, data_offset: 34, }, GlyphInfo { character: '$', width: 9, height: 16, x_offset: 1, y_offset: 0, x_advance: 11, data_offset: 99, }, GlyphInfo { character: '%', width: 11, height: 14, x_offset: 0, y_offset: 1, x_advance: 11, data_offset: 171, }, GlyphInfo { character: '&', width: 10, height: 15, x_offset: 1, y_offset: 0, x_advance: 11, data_offset: 248, }, GlyphInfo { character: '\'', width: 2, height: 5, x_offset: 4, y_offset: 1, x_advance: 11, data_offset: 323, }, GlyphInfo { character: '(', width: 5, height: 16, x_offset: 3, y_offset: 1,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_28_bold.rs
frostsnap_fonts/src/noto_sans_mono_28_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 28px //! Weight: 700 //! Characters: 95 //! Line height: 29px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_28_BOLD_DATA: &[u8] = &[ 0x0e, 0xff, 0xfc, 0x0e, 0xff, 0xfc, 0x0d, 0xff, 0xfc, 0x0d, 0xff, 0xfb, 0x0c, 0xff, 0xfb, 0x0c, 0xff, 0xfa, 0x0b, 0xff, 0xfa, 0x0b, 0xff, 0xf9, 0x0b, 0xff, 0xf9, 0x0a, 0xff, 0xf8, 0x0a, 0xff, 0xf7, 0x09, 0xff, 0xf7, 0x09, 0xff, 0xf6, 0x04, 0x88, 0x83, 0x00, 0x00, 0x00, 0x03, 0xab, 0x91, 0x0d, 0xff, 0xfa, 0x3f, 0xff, 0xfd, 0x2e, 0xff, 0xfd, 0x0a, 0xef, 0xe7, 0x00, 0x46, 0x30, 0x8f, 0xff, 0xa0, 0xcf, 0xff, 0x46, 0xff, 0xf9, 0x0b, 0xff, 0xf2, 0x5f, 0xff, 0x80, 0xaf, 0xfe, 0x04, 0xff, 0xf7, 0x09, 0xff, 0xe0, 0x2f, 0xff, 0x60, 0x9f, 0xfd, 0x00, 0xef, 0xf4, 0x08, 0xff, 0xc0, 0x0e, 0xff, 0x20, 0x7f, 0xfc, 0x00, 0x66, 0x60, 0x02, 0x66, 0x50, 0x00, 0x00, 0x04, 0xff, 0xc0, 0x0d, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfa, 0x01, 0xef, 0xd0, 0x00, 0x00, 0x00, 0x09, 0xff, 0x80, 0x5f, 0xfb, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xf6, 0x08, 0xff, 0x90, 0x00, 0x00, 0x00, 0x0c, 0xff, 0x30, 0xaf, 0xf7, 0x00, 0x00, 0x89, 0x99, 0xef, 0xe9, 0x9d, 0xff, 0xa9, 0x95, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x06, 0x77, 0xbf, 0xfb, 0x79, 0xff, 0xc7, 0x77, 0x40, 0x00, 0x0a, 0xff, 0x70, 0x7f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xf4, 0x0a, 0xff, 0x70, 0x00, 0x06, 0x88, 0x8e, 0xfe, 0x88, 0xcf, 0xf9, 0x88, 0x50, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x69, 0x9b, 0xff, 0xb9, 0xaf, 0xfd, 0x99, 0x96, 0x00, 0x00, 0xaf, 0xf7, 0x08, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0c, 0xff, 0x40, 0xaf, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xe0, 0x0c, 0xff, 0x50, 0x00, 0x00, 0x00, 0x1e, 0xfd, 0x00, 0xdf, 0xe2, 0x00, 0x00, 0x00, 0x05, 0xff, 0xb0, 0x1e, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xfa, 0x53, 0x00, 0x00, 0x07, 0xdf, 0xff, 0xff, 0xfd, 0xa3, 0x09, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x45, 0xef, 0xff, 0xef, 0xee, 0xff, 0xc0, 0xaf, 0xfe, 0x79, 0xf8, 0x26, 0xb8, 0x0c, 0xff, 0xd0, 0x9f, 0x80, 0x00, 0x00, 0xbf, 0xfe, 0x49, 0xf8, 0x00, 0x00, 0x09, 0xff, 0xfe, 0xcf, 0x80, 0x00, 0x00, 0x2d, 0xff, 0xff, 0xfc, 0x50, 0x00, 0x00, 0x3c, 0xff, 0xff, 0xff, 0xc5, 0x00, 0x00, 0x07, 0xdf, 0xff, 0xff, 0xe7, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x09, 0xf9, 0xcf, 0xff, 0x90, 0x00, 0x00, 0x9f, 0x82, 0xef, 0xfa, 0x72, 0x00, 0x09, 0xf8, 0x2e, 0xff, 0xac, 0xeb, 0x74, 0x9f, 0xac, 0xff, 0xf6, 0xcf, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x30, 0x28, 0xbd, 0xee, 0xfe, 0xc8, 0x10, 0x00, 0x00, 0x00, 0x9f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x09, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x60, 0x00, 0x00, 0x00, 0x15, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0xff, 0xe8, 0x00, 0x00, 0x8f, 0xfb, 0x00, 0x6e, 0xff, 0xff, 0xf7, 0x00, 0x1d, 0xfe, 0x40, 0x0c, 0xff, 0x88, 0xff, 0xc0, 0x09, 0xff, 0xb0, 0x00, 0xef, 0xd0, 0x0d, 0xfe, 0x02, 0xef, 0xe4, 0x00, 0x0e, 0xfc, 0x00, 0xcf, 0xe0, 0x9f, 0xfb, 0x00, 0x00, 0xef, 0xd0, 0x0d, 0xfe, 0x2e, 0xfe, 0x40, 0x00, 0x0c, 0xfe, 0x77, 0xff, 0xc9, 0xff, 0xa0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0xef, 0xe3, 0x00, 0x00, 0x00, 0x9e, 0xff, 0xe9, 0x9f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x26, 0x62, 0x2e, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xa0, 0x26, 0x50, 0x00, 0x00, 0x00, 0x03, 0xef, 0xe3, 0xae, 0xff, 0xd6, 0x00, 0x00, 0x00, 0xaf, 0xfa, 0x9f, 0xff, 0xff, 0xe4, 0x00, 0x00, 0x3e, 0xfe, 0x3e, 0xfe, 0x6a, 0xff, 0xa0, 0x00, 0x0a, 0xff, 0x94, 0xff, 0xb0, 0x2f, 0xfc, 0x00, 0x03, 0xef, 0xe2, 0x5f, 0xfa, 0x00, 0xef, 0xd0, 0x00, 0xaf, 0xf9, 0x04, 0xff, 0xb0, 0x2e, 0xfc, 0x00, 0x4e, 0xfe, 0x20, 0x0e, 0xfe, 0x6a, 0xff, 0xa0, 0x0b, 0xff, 0x90, 0x00, 0x9f, 0xff, 0xff, 0xe4, 0x04, 0xef, 0xe2, 0x00, 0x01, 0xae, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x51, 0x00, 0x00, 0x00, 0x02, 0x66, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xef, 0xfe, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xff, 0xff, 0xd1, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0xbe, 0xff, 0x80, 0x00, 0x00, 0x00, 0x9f, 0xfe, 0x10, 0xcf, 0xfa, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x0c, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x9f, 0xfe, 0x13, 0xef, 0xf9, 0x00, 0x00, 0x00, 0x06, 0xff, 0xf8, 0xcf, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x1d, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xff, 0xf1, 0x02, 0xaa, 0xa7, 0x00, 0x08, 0xef, 0xff, 0xfe, 0x60, 0x6f, 0xff, 0x90, 0x05, 0xef, 0xff, 0xff, 0xfd, 0x3a, 0xff, 0xf5, 0x00, 0xbf, 0xff, 0x89, 0xff, 0xfc, 0xdf, 0xfe, 0x00, 0x1e, 0xff, 0xc0, 0x0c, 0xff, 0xff, 0xff, 0xa0, 0x04, 0xff, 0xf9, 0x00, 0x4e, 0xff, 0xff, 0xe4, 0x00, 0x4f, 0xff, 0xb0, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x01, 0xef, 0xfe, 0x72, 0x5b, 0xff, 0xff, 0xd0, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00, 0x4e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x00, 0x5c, 0xef, 0xff, 0xea, 0x29, 0xff, 0xfe, 0x30, 0x00, 0x03, 0x66, 0x50, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x79, 0xff, 0xf6, 0x8f, 0xff, 0x57, 0xff, 0xf3, 0x6f, 0xfe, 0x05, 0xff, 0xe0, 0x3f, 0xfd, 0x01, 0x66, 0x50, 0x00, 0x04, 0xef, 0xf7, 0x00, 0x0c, 0xff, 0xc0, 0x00, 0x7f, 0xfe, 0x50, 0x00, 0xdf, 0xfc, 0x00, 0x06, 0xff, 0xf7, 0x00, 0x0b, 0xff, 0xe1, 0x00, 0x0e, 0xff, 0xb0, 0x00, 0x5f, 0xff, 0x90, 0x00, 0x8f, 0xff, 0x60, 0x00, 0xaf, 0xff, 0x20, 0x00, 0xbf, 0xfe, 0x00, 0x00, 0xbf, 0xfe, 0x00, 0x00, 0xcf, 0xfd, 0x00, 0x00, 0xbf, 0xfe, 0x00, 0x00, 0xbf, 0xfe, 0x10, 0x00, 0x9f, 0xff, 0x30, 0x00, 0x7f, 0xff, 0x70, 0x00, 0x4f, 0xff, 0xa0, 0x00, 0x0d, 0xff, 0xc0, 0x00, 0x0a, 0xff, 0xe3, 0x00, 0x04, 0xef, 0xf9, 0x00, 0x00, 0xbf, 0xfd, 0x00, 0x00, 0x5e, 0xff, 0x80, 0x00, 0x09, 0xff, 0xe2, 0x00, 0x01, 0xbb, 0xb6, 0xaf, 0xfd, 0x10, 0x00, 0x2d, 0xff, 0xa0, 0x00, 0x08, 0xff, 0xe5, 0x00, 0x01, 0xef, 0xfb, 0x00, 0x00, 0xaf, 0xfe, 0x30, 0x00, 0x4f, 0xff, 0x90, 0x00, 0x0d, 0xff, 0xc0, 0x00, 0x0b, 0xff, 0xe1, 0x00, 0x08, 0xff, 0xf5, 0x00, 0x06, 0xff, 0xf7, 0x00, 0x05, 0xff, 0xf9, 0x00, 0x04, 0xff, 0xf9, 0x00, 0x03, 0xff, 0xf9, 0x00, 0x04, 0xff, 0xf9, 0x00, 0x06, 0xff, 0xf8, 0x00, 0x07, 0xff, 0xf6, 0x00, 0x0a, 0xff, 0xf3, 0x00, 0x0c, 0xff, 0xd0, 0x00, 0x0e, 0xff, 0xb0, 0x00, 0x6f, 0xff, 0x60, 0x00, 0xbf, 0xfd, 0x00, 0x03, 0xef, 0xf9, 0x00, 0x0a, 0xff, 0xd2, 0x00, 0x5e, 0xff, 0x60, 0x00, 0x8b, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x25, 0x55, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x4f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0xef, 0xd0, 0x00, 0x00, 0x6a, 0x61, 0x0e, 0xfc, 0x02, 0x7b, 0x4a, 0xff, 0xec, 0xef, 0xdc, 0xef, 0xf8, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa7, 0x9a, 0xce, 0xff, 0xfe, 0xca, 0x96, 0x00, 0x06, 0xef, 0xff, 0xe4, 0x00, 0x00, 0x03, 0xef, 0xe9, 0xff, 0xd1, 0x00, 0x01, 0xcf, 0xfb, 0x0d, 0xff, 0xb0, 0x00, 0x5e, 0xfe, 0x30, 0x7f, 0xfd, 0x30, 0x00, 0x2a, 0xa0, 0x00, 0xc9, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xbb, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x18, 0x88, 0x89, 0xff, 0xe8, 0x88, 0x87, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2b, 0xbb, 0xbb, 0xff, 0xeb, 0xbb, 0xba, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x02, 0xcc, 0xc0, 0x00, 0x00, 0x04, 0xdd, 0xdc, 0x07, 0xff, 0xfc, 0x09, 0xff, 0xf9, 0x0b, 0xff, 0xf5, 0x0d, 0xff, 0xd0, 0x1e, 0xff, 0xa0, 0x5f, 0xff, 0x50, 0x8f, 0xfc, 0x00, 0x68, 0x85, 0x00, 0x56, 0x66, 0x66, 0x66, 0x4d, 0xff, 0xff, 0xff, 0xfb, 0xdf, 0xff, 0xff, 0xff, 0xbd, 0xff, 0xff, 0xff, 0xfb, 0x67, 0x77, 0x77, 0x77, 0x50, 0x03, 0xab, 0x91, 0x0d, 0xff, 0xfa, 0x3f, 0xff, 0xfd, 0x2e, 0xff, 0xfd, 0x0a, 0xef, 0xe7, 0x00, 0x46, 0x30, 0x00, 0x00, 0x00, 0x00, 0x24, 0x44, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfc, 0x00, 0x00, 0x00, 0x04, 0xef, 0xf8, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x60, 0x00, 0x00, 0x00, 0xbf, 0xfd, 0x00, 0x00, 0x00, 0x02, 0xef, 0xfa, 0x00, 0x00, 0x00, 0x09, 0xff, 0xe4, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x5f, 0xff, 0x80, 0x00, 0x00, 0x00, 0xaf, 0xfe, 0x20, 0x00, 0x00, 0x01, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x3e, 0xff, 0x90, 0x00, 0x00, 0x00, 0x9f, 0xfe, 0x40, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe1, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x14, 0x44, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x66, 0x51, 0x00, 0x00, 0x00, 0x00, 0x5c, 0xef, 0xff, 0xea, 0x20, 0x00, 0x00, 0x7e, 0xff, 0xff, 0xff, 0xfd, 0x30, 0x00, 0x3e, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x0a, 0xff, 0xfe, 0x75, 0x9f, 0xff, 0xf6, 0x00, 0xef, 0xff, 0x60, 0x04, 0xff, 0xff, 0xb0, 0x5f, 0xff, 0xd0, 0x00, 0xbf, 0xff, 0xfe, 0x08, 0xff, 0xfb, 0x00, 0x7f, 0xff, 0xff, 0xf4, 0x9f, 0xff, 0x90, 0x1d, 0xff, 0xff, 0xff, 0x7a, 0xff, 0xf8, 0x09, 0xff, 0xdc, 0xff, 0xf8, 0xbf, 0xff, 0x84, 0xef, 0xe6, 0xbf, 0xff, 0x8b, 0xff, 0xf7, 0xcf, 0xfb, 0x0b, 0xff, 0xf8, 0xaf, 0xff, 0xbf, 0xfe, 0x30, 0xbf, 0xff, 0x89, 0xff, 0xff, 0xff, 0x80, 0x0c, 0xff, 0xf7, 0x7f, 0xff, 0xff, 0xd0, 0x00, 0xdf, 0xff, 0x44, 0xff, 0xff, 0xe5, 0x00, 0x2e, 0xff, 0xe1, 0x0d, 0xff, 0xfc, 0x00, 0x08, 0xff, 0xfc, 0x00, 0x9f, 0xff, 0xd5, 0x27, 0xef, 0xff, 0x70, 0x02, 0xef, 0xff, 0xff, 0xff, 0xff, 0xd1, 0x00, 0x06, 0xef, 0xff, 0xff, 0xff, 0xe4, 0x00, 0x00, 0x04, 0xce, 0xff, 0xfe, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x26, 0x75, 0x20, 0x00, 0x00, 0x00, 0x00, 0x07, 0xdf, 0xff, 0x40, 0x00, 0x00, 0x06, 0xdf, 0xff, 0xff, 0x40, 0x00, 0x05, 0xcf, 0xff, 0xff, 0xff, 0x40, 0x00, 0x1d, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00, 0x08, 0xff, 0xfd, 0xef, 0xff, 0x40, 0x00, 0x00, 0xde, 0x91, 0xef, 0xff, 0x40, 0x00, 0x00, 0x53, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x35, 0xff, 0xff, 0x73, 0x00, 0x00, 0xce, 0xff, 0xff, 0xff, 0xff, 0xec, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x00, 0x00, 0x03, 0x66, 0x52, 0x00, 0x00, 0x00, 0x02, 0x9d, 0xff, 0xff, 0xec, 0x60, 0x00, 0x06, 0xdf, 0xff, 0xff, 0xff, 0xfe, 0x90, 0x06, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x0c, 0xff, 0xeb, 0x87, 0xbe, 0xff, 0xfc, 0x00, 0x2d, 0xc4, 0x00, 0x00, 0xaf, 0xff, 0xe0, 0x00, 0x31, 0x00, 0x00, 0x07, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x06, 0xef, 0xfe, 0x60, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xd2, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xd4, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xd3, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xc2, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xb1, 0x00, 0x00, 0x00, 0x03, 0xdf, 0xff, 0xe9, 0x99, 0x99, 0x99, 0x97, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x00, 0x00, 0x04, 0x66, 0x51, 0x00, 0x00, 0x00, 0x5b, 0xdf, 0xff, 0xfe, 0xb5, 0x00, 0x0b, 0xef, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x02, 0xef, 0xd9, 0x77, 0xae, 0xff, 0xf6, 0x00, 0x66, 0x00, 0x00, 0x0c, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x05, 0xbf, 0xff, 0x90, 0x00, 0x03, 0xee, 0xef, 0xff, 0xe9, 0x00, 0x00, 0x04, 0xff, 0xff, 0xfd, 0x81, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, 0xfd, 0x70, 0x00, 0x02, 0x88, 0x8a, 0xdf, 0xff, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfe, 0x06, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfd, 0x1f, 0xda, 0x75, 0x57, 0xbf, 0xff, 0xfa, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x08, 0xbe, 0xff, 0xff, 0xfd, 0xa3, 0x00, 0x00, 0x00, 0x46, 0x76, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xef, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x40, 0x00, 0x00, 0x00, 0x2d, 0xff, 0xff, 0xf4, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xef, 0xff, 0x40, 0x00, 0x00, 0x05, 0xef, 0xec, 0xff, 0xf4, 0x00, 0x00, 0x01, 0xdf, 0xf9, 0xbf, 0xff, 0x40, 0x00, 0x00, 0x9f, 0xfd, 0x2c, 0xff, 0xf4, 0x00, 0x00, 0x4e, 0xff, 0x70, 0xcf, 0xff, 0x40, 0x00, 0x0c, 0xff, 0xc0, 0x0c, 0xff, 0xf4, 0x00, 0x08, 0xff, 0xe4, 0x00, 0xcf, 0xff, 0x40, 0x03, 0xef, 0xfa, 0x00, 0x0c, 0xff, 0xf4, 0x00, 0xbf, 0xfe, 0x99, 0x99, 0xdf, 0xff, 0xa9, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xdd, 0xdd, 0xdd, 0xde, 0xff, 0xfd, 0xdb, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf4, 0x00, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x01, 0xff, 0xfe, 0xaa, 0xaa, 0xaa, 0x70, 0x4f, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x05, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfd, 0xbc, 0xb9, 0x40, 0x00, 0x9f, 0xff, 0xff, 0xff, 0xfe, 0x90, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x5c, 0xec, 0xbb, 0xdf, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x9f, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xb6, 0x10, 0x00, 0x00, 0x4e, 0xff, 0xf9, 0xde, 0xb9, 0x77, 0x9d, 0xff, 0xfe, 0x4d, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0xdf, 0xff, 0xff, 0xff, 0xfe, 0xa0, 0x08, 0xce, 0xff, 0xff, 0xec, 0x60, 0x00, 0x00, 0x15, 0x66, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x65, 0x30, 0x00, 0x00, 0x00, 0x5b, 0xdf, 0xff, 0xfd, 0x00, 0x00, 0x02, 0xbe, 0xff, 0xff, 0xff, 0xd0, 0x00, 0x02, 0xdf, 0xff, 0xff, 0xff, 0xfd, 0x00, 0x00, 0xbf, 0xff, 0xec, 0x75, 0x45, 0x70, 0x00, 0x6f, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xff, 0xc1, 0x9d, 0xee, 0xc8, 0x00, 0x07, 0xff, 0xfb, 0xcf, 0xff, 0xff, 0xfb, 0x00, 0x8f, 0xff, 0xef, 0xff, 0xff, 0xff, 0xf8, 0x09, 0xff, 0xff, 0xea, 0x79, 0xef, 0xff, 0xd0, 0x9f, 0xff, 0xf8, 0x00, 0x07, 0xff, 0xff, 0x38, 0xff, 0xfe, 0x00, 0x00, 0x0e, 0xff, 0xf6, 0x6f, 0xff, 0xc0, 0x00, 0x00, 0xdf, 0xff, 0x62, 0xef, 0xfd, 0x00, 0x00, 0x0e, 0xff, 0xf5, 0x0c, 0xff, 0xf7, 0x00, 0x07, 0xff, 0xfe, 0x20, 0x8f, 0xff, 0xea, 0x79, 0xef, 0xff, 0xb0, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x00, 0x04, 0xdf, 0xff, 0xff, 0xff, 0xe8, 0x00, 0x00, 0x03, 0xbe, 0xff, 0xfe, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x16, 0x76, 0x30, 0x00, 0x00, 0xbe, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x8b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x02, 0xef, 0xff, 0x50, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfd, 0x10, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x05, 0xff, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x4e, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x02, 0xef, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x56, 0x51, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xef, 0xff, 0xec, 0x50, 0x00, 0x00, 0x9f, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x00, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x30, 0x0b, 0xff, 0xfd, 0x64, 0x8e, 0xff, 0xf8, 0x00, 0xcf, 0xff, 0x80, 0x00, 0xaf, 0xff, 0xa0, 0x0b, 0xff, 0xf8, 0x00, 0x0a, 0xff, 0xf9, 0x00, 0x8f, 0xff, 0xd3, 0x04, 0xef, 0xfe, 0x40, 0x02, 0xdf, 0xff, 0xd9, 0xef, 0xff, 0xa0, 0x00, 0x05, 0xef, 0xff, 0xff, 0xfe, 0xa0, 0x00, 0x00, 0x05, 0xef, 0xff, 0xff, 0xb0, 0x00, 0x00, 0x07, 0xef, 0xff, 0xff, 0xff, 0xc2, 0x00, 0x06, 0xef, 0xff, 0xca, 0xef, 0xff, 0xd2, 0x00, 0xdf, 0xff, 0xa0, 0x05, 0xdf, 0xff, 0xa0, 0x5f, 0xff, 0xd1, 0x00, 0x05, 0xef, 0xfe, 0x17, 0xff, 0xfb, 0x00, 0x00, 0x0d, 0xff, 0xf4, 0x7f, 0xff, 0xc0, 0x00, 0x02, 0xef, 0xff, 0x24, 0xef, 0xff, 0xa4, 0x25, 0xcf, 0xff, 0xd0, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x29, 0xdf, 0xff, 0xfe, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x46, 0x75, 0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x67, 0x50, 0x00, 0x00, 0x00, 0x00, 0x8d, 0xff, 0xff, 0xd9, 0x10, 0x00, 0x00, 0xaf, 0xff, 0xff, 0xff, 0xfc, 0x10, 0x00, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x0d, 0xff, 0xfd, 0x87, 0xbf, 0xff, 0xe5, 0x05, 0xff, 0xfe, 0x40, 0x00, 0xaf, 0xff, 0xa0, 0x8f, 0xff, 0xc0, 0x00, 0x04, 0xff, 0xfd, 0x09, 0xff, 0xfb, 0x00, 0x00, 0x0e, 0xff, 0xe3, 0x9f, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0x57, 0xff, 0xfe, 0x30, 0x00, 0xaf, 0xff, 0xf6, 0x3e, 0xff, 0xfd, 0x87, 0xbf, 0xff, 0xff, 0x60, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xf5, 0x03, 0xdf, 0xff, 0xff, 0xfa, 0xcf, 0xff, 0x40, 0x02, 0xad, 0xee, 0xc8, 0x1e, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x90, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0xe2, 0x00, 0x25, 0x32, 0x47, 0xcf, 0xff, 0xf9, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x4f, 0xff, 0xff, 0xff, 0xea, 0x10, 0x00, 0x04, 0xff, 0xff, 0xfe, 0xb5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x64, 0x00, 0x00, 0x00, 0x00, 0x02, 0x9a, 0x80, 0x0c, 0xff, 0xfa, 0x3f, 0xff, 0xfd, 0x2e, 0xff, 0xfd, 0x0b, 0xff, 0xe8, 0x00, 0x67, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xab, 0x91, 0x0d, 0xff, 0xfa, 0x3f, 0xff, 0xfd, 0x2e, 0xff, 0xfd, 0x0a, 0xef, 0xe7, 0x00, 0x46, 0x30, 0x00, 0x5a, 0xa5, 0x00, 0x5e, 0xff, 0xe5, 0x09, 0xff, 0xff, 0x90, 0x9f, 0xff, 0xf9, 0x03, 0xdf, 0xfd, 0x30, 0x02, 0x77, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xdd, 0xdc, 0x00, 0x7f, 0xff, 0xc0, 0x09, 0xff, 0xf9, 0x00, 0xbf, 0xff, 0x50, 0x0d, 0xff, 0xd0, 0x01, 0xef, 0xfa, 0x00, 0x5f, 0xff, 0x50, 0x08, 0xff, 0xc0, 0x00, 0x68, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xef, 0x90, 0x00, 0x00, 0x03, 0xae, 0xff, 0xf9, 0x00, 0x00, 0x3a, 0xef, 0xff, 0xeb, 0x40, 0x02, 0xae, 0xff, 0xfe, 0xb5, 0x00, 0x29, 0xef, 0xff, 0xeb, 0x50, 0x00, 0x0b, 0xff, 0xfe, 0xb4, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xea, 0x40, 0x00, 0x00, 0x04, 0xbe, 0xff, 0xfe, 0xb5, 0x00, 0x00, 0x00, 0x4b, 0xef, 0xff, 0xfc, 0x60, 0x00, 0x00, 0x04, 0xae, 0xff, 0xff, 0xd5, 0x00, 0x00, 0x00, 0x3a, 0xef, 0xff, 0x90, 0x00, 0x00, 0x00, 0x03, 0xae, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x80, 0x16, 0x66, 0x66, 0x66, 0x66, 0x66, 0x65, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x05, 0x55, 0x55, 0x55, 0x55, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xea, 0x20, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfe, 0x92, 0x00, 0x00, 0x00, 0x6c, 0xff, 0xff, 0xe9, 0x20, 0x00, 0x00, 0x06, 0xcf, 0xff, 0xfe, 0x91, 0x00, 0x00, 0x00, 0x6c, 0xff, 0xff, 0xd8, 0x10, 0x00, 0x00, 0x06, 0xcf, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x6b, 0xef, 0xff, 0x90, 0x00, 0x07, 0xcf, 0xff, 0xfe, 0xa3, 0x01, 0x8d, 0xff, 0xff, 0xea, 0x30, 0x07, 0xdf, 0xff, 0xfe, 0x92, 0x00, 0x00, 0xbf, 0xff, 0xe9, 0x20, 0x00, 0x00, 0x0b, 0xfd, 0x91, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x65, 0x20, 0x00, 0x00, 0x5a, 0xdf, 0xff, 0xfe, 0xc6, 0x00, 0xae, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x0c, 0xec, 0x85, 0x48, 0xef, 0xff, 0x80, 0x54, 0x00, 0x00, 0x09, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x4d, 0xff, 0xfd, 0x10, 0x00, 0x00, 0x7e, 0xff, 0xfd, 0x40, 0x00, 0x00, 0x7e, 0xff, 0xfc, 0x20, 0x00, 0x00, 0x0d, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x04, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0x90, 0x00, 0x00, 0x00, 0x03, 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9b, 0xa3, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xff, 0x40, 0x00, 0x00, 0x00, 0xdf, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x07, 0xef, 0xea, 0x00, 0x00, 0x00, 0x00, 0x03, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xad, 0xee, 0xdb, 0x50, 0x00, 0x00, 0x00, 0x1a, 0xef, 0xff, 0xff, 0xfe, 0x90, 0x00, 0x00, 0x1c, 0xff, 0xea, 0x88, 0xae, 0xff, 0x90, 0x00, 0x0a, 0xff, 0xc3, 0x00, 0x00, 0x4d, 0xfe, 0x50, 0x05, 0xef, 0xd2, 0x00, 0x00, 0x00, 0x5e, 0xfc, 0x00, 0xcf, 0xf6, 0x00, 0x7a, 0x98, 0x40, 0xbf, 0xe4, 0x4e, 0xfc, 0x02, 0xcf, 0xff, 0xfe, 0x97, 0xff, 0x99, 0xff, 0x80, 0xbf, 0xfe, 0xef, 0xf9, 0x4f, 0xfb, 0xbf, 0xf4, 0x5e, 0xfd, 0x38, 0xff, 0x80, 0xef, 0xcd, 0xfe, 0x09, 0xff, 0x70, 0x8f, 0xf7, 0x0e, 0xfc, 0xef, 0xd0, 0xbf, 0xf3, 0x09, 0xff, 0x70, 0xef, 0xce, 0xfd, 0x0b, 0xfe, 0x00, 0xaf, 0xf6, 0x2f, 0xfc, 0xef, 0xd0, 0xbf, 0xf1, 0x0b, 0xff, 0x54, 0xff, 0xae, 0xfd, 0x0a, 0xff, 0x51, 0xef, 0xf6, 0x8f, 0xf7, 0xdf, 0xe1, 0x5f, 0xfd, 0xcf, 0xff, 0xcd, 0xfd, 0x1b, 0xff, 0x60, 0xcf, 0xff, 0xec, 0xff, 0xfe, 0x70, 0x8f, 0xfa, 0x03, 0xce, 0xd7, 0x2b, 0xed, 0x80, 0x02, 0xef, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xff, 0xd7, 0x10, 0x01, 0x5a, 0xc0, 0x00, 0x00, 0x3c, 0xff, 0xfe, 0xdd, 0xef, 0xfe, 0x00, 0x00, 0x00, 0x19, 0xdf, 0xff, 0xff, 0xfd, 0x90, 0x00, 0x00, 0x00, 0x00, 0x58, 0x99, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xff, 0xdf, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x09, 0xff, 0xe8, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfd, 0x2e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xb0, 0xdf, 0xfd, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf8, 0x0a, 0xff, 0xe3, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x40, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x0d, 0xff, 0xd0, 0x03, 0xef, 0xfb, 0x00, 0x00, 0x04, 0xff, 0xfb, 0x00, 0x0d, 0xff, 0xe0, 0x00, 0x00, 0x8f, 0xff, 0xb7, 0x77, 0xef, 0xff, 0x50, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x01, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x20, 0x0a, 0xff, 0xf9, 0x22, 0x22, 0x2b, 0xff, 0xf7, 0x00, 0xcf, 0xff, 0x40, 0x00, 0x00, 0x8f, 0xff, 0xa0, 0x2e, 0xff, 0xd0, 0x00, 0x00, 0x05, 0xff, 0xfd, 0x07, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xf4, 0xbf, 0xff, 0x80, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x80, 0xcf, 0xff, 0xff, 0xee, 0xdb, 0x81, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x30, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xff, 0x88, 0x8a, 0xdf, 0xff, 0xe3, 0xcf, 0xff, 0x10, 0x00, 0x4e, 0xff, 0xf6, 0xcf, 0xff, 0x10, 0x00, 0x0e, 0xff, 0xf5, 0xcf, 0xff, 0x10, 0x00, 0x2e, 0xff, 0xe3, 0xcf, 0xff, 0x44, 0x56, 0xcf, 0xff, 0xb0, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x30, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x70, 0xcf, 0xff, 0x77, 0x79, 0xcf, 0xff, 0xe4, 0xcf, 0xff, 0x10, 0x00, 0x1d, 0xff, 0xf9, 0xcf, 0xff, 0x10, 0x00, 0x0b, 0xff, 0xfb, 0xcf, 0xff, 0x10, 0x00, 0x0b, 0xff, 0xfb, 0xcf, 0xff, 0x10, 0x00, 0x2e, 0xff, 0xfa, 0xcf, 0xff, 0x88, 0x89, 0xdf, 0xff, 0xf6, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x30, 0xcf, 0xff, 0xff, 0xfe, 0xdc, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x56, 0x64, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xef, 0xff, 0xfe, 0xb5, 0x00, 0x04, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x90, 0x05, 0xef, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x01, 0xdf, 0xff, 0xfc, 0x97, 0x8a, 0xdb, 0x00, 0x8f, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x20, 0x0d, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0xef, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xfe, 0x50, 0x00, 0x00, 0x05, 0x00, 0x5e, 0xff, 0xfe, 0xb8, 0x79, 0xad, 0xe0, 0x00, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x7c, 0xef, 0xff, 0xfe, 0xc8, 0x00, 0x00, 0x00, 0x02, 0x67, 0x64, 0x10, 0x00, 0xcf, 0xff, 0xff, 0xee, 0xda, 0x40, 0x00, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xa0, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x0c, 0xff, 0xfb, 0x9a, 0xbe, 0xff, 0xff, 0x80, 0xcf, 0xff, 0x70, 0x00, 0x3c, 0xff, 0xfe, 0x1c, 0xff, 0xf7, 0x00, 0x00, 0x3e, 0xff, 0xf7, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xbf, 0xff, 0xbc, 0xff, 0xf7, 0x00, 0x00, 0x08, 0xff, 0xfd, 0xcf, 0xff, 0x70, 0x00, 0x00, 0x6f, 0xff, 0xec, 0xff, 0xf7, 0x00, 0x00, 0x05, 0xff, 0xfe, 0xcf, 0xff, 0x70, 0x00, 0x00, 0x5f, 0xff, 0xec, 0xff, 0xf7, 0x00, 0x00, 0x06, 0xff, 0xfd, 0xcf, 0xff, 0x70, 0x00, 0x00, 0x9f, 0xff, 0xcc, 0xff, 0xf7, 0x00, 0x00, 0x0c, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x05, 0xef, 0xff, 0x6c, 0xff, 0xf7, 0x00, 0x04, 0xdf, 0xff, 0xd0, 0xcf, 0xff, 0xb9, 0xab, 0xef, 0xff, 0xe6, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x00, 0x0c, 0xff, 0xff, 0xfe, 0xec, 0x93, 0x00, 0x00, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xfb, 0xaa, 0xaa, 0xaa, 0xa9, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf7, 0x44, 0x44, 0x44, 0x42, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xf9, 0x88, 0x88, 0x88, 0x85, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xba, 0xaa, 0xaa, 0xaa, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xfb, 0xaa, 0xaa, 0xaa, 0xa9, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x87, 0x77, 0x77, 0x77, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xcf, 0xff, 0x86, 0x66, 0x66, 0x66, 0x3c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x56, 0x65, 0x10, 0x00, 0x00, 0x00, 0x07, 0xce, 0xff, 0xff, 0xec, 0x92, 0x00, 0x02, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xf5, 0x00, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xaf, 0xff, 0xfe, 0xa8, 0x78, 0xae, 0x80, 0x03, 0xef, 0xff, 0xc2, 0x00, 0x00, 0x01, 0x20, 0x09, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xf1, 0x00, 0x06, 0x66, 0x66, 0x64, 0x4f, 0xff, 0xe0, 0x00, 0x0e, 0xff, 0xff, 0xfa, 0x4f, 0xff, 0xe0, 0x00, 0x0e, 0xff, 0xff, 0xfa, 0x2f, 0xff, 0xe0, 0x00, 0x0e, 0xff, 0xff, 0xfa, 0x0e, 0xff, 0xf5, 0x00, 0x04, 0x46, 0xff, 0xfa, 0x0d, 0xff, 0xf8, 0x00, 0x00, 0x04, 0xff, 0xfa, 0x0a, 0xff, 0xfd, 0x00, 0x00, 0x04, 0xff, 0xfa, 0x06, 0xff, 0xff, 0xa0, 0x00, 0x04, 0xff, 0xfa, 0x00, 0xcf, 0xff, 0xfc, 0x86, 0x69, 0xff, 0xfa, 0x00, 0x4e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x05, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x29, 0xdf, 0xff, 0xff, 0xed, 0xa4, 0x00, 0x00, 0x00, 0x03, 0x67, 0x65, 0x20, 0x00, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf9, 0x55, 0x55, 0x5b, 0xff, 0xfa, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xac, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xac, 0xff, 0xfa, 0x77, 0x77, 0x7b, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xcf, 0xff, 0x70, 0x00, 0x00, 0xaf, 0xff, 0xac, 0xff, 0xf7, 0x00, 0x00, 0x0a, 0xff, 0xfa, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x9e, 0xff, 0xff, 0xff, 0xff, 0xee, 0x60, 0x02, 0x5c, 0xff, 0xf9, 0x41, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x70, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x25, 0xcf, 0xff, 0x94, 0x10, 0x09, 0xee, 0xff, 0xff, 0xff, 0xfe, 0xe6, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x07, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x09, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x1d, 0xff, 0xf9, 0x9a, 0x97, 0x78, 0xcf, 0xff, 0xf5, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xbf, 0xff, 0xff, 0xff, 0xfd, 0x30, 0x9e, 0xff,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_17_regular.rs
frostsnap_fonts/src/noto_sans_mono_17_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 17px //! Weight: 400 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_17_REGULAR_DATA: &[u8] = &[ 0x45, 0x0d, 0xf1, 0xce, 0x0c, 0xe0, 0xce, 0x0c, 0xe0, 0xbd, 0x0b, 0xd0, 0xbd, 0x07, 0x90, 0x23, 0x0d, 0xe3, 0xde, 0x32, 0x30, 0x25, 0x21, 0x53, 0x6f, 0x74, 0xf9, 0x5f, 0x61, 0xe8, 0x3f, 0x40, 0xe7, 0x1e, 0x20, 0xd6, 0x06, 0x00, 0x62, 0x00, 0x00, 0x42, 0x04, 0x30, 0x00, 0x04, 0xf4, 0x0d, 0x80, 0x00, 0x07, 0xe0, 0x1e, 0x60, 0x00, 0x0a, 0xc0, 0x5e, 0x20, 0x1a, 0xad, 0xda, 0xbe, 0xa9, 0x1b, 0xbe, 0xcb, 0xdd, 0xba, 0x00, 0x3e, 0x40, 0xd9, 0x00, 0x00, 0x7e, 0x01, 0xe6, 0x00, 0x9c, 0xde, 0xcc, 0xfc, 0xc5, 0x79, 0xdc, 0x9c, 0xe9, 0x94, 0x00, 0xd8, 0x0a, 0xb0, 0x00, 0x02, 0xe5, 0x0c, 0x90, 0x00, 0x05, 0xe1, 0x0e, 0x70, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x03, 0x9d, 0xda, 0x82, 0x4e, 0xed, 0xdd, 0xe5, 0xae, 0x4a, 0xa0, 0x30, 0xbe, 0x0a, 0xa0, 0x00, 0x8f, 0xab, 0xa0, 0x00, 0x0a, 0xef, 0xd8, 0x20, 0x00, 0x3c, 0xee, 0xd5, 0x00, 0x0a, 0xa5, 0xec, 0x00, 0x0a, 0xa0, 0xcd, 0x66, 0x2a, 0xb7, 0xea, 0x9f, 0xee, 0xff, 0xc2, 0x05, 0x8c, 0xc4, 0x00, 0x00, 0x0a, 0xa0, 0x00, 0x03, 0x63, 0x00, 0x03, 0x40, 0x07, 0xed, 0xe5, 0x01, 0xd9, 0x00, 0xd9, 0x0b, 0xc0, 0x8e, 0x20, 0x0e, 0x70, 0x9d, 0x1d, 0x90, 0x00, 0xd8, 0x0a, 0xc8, 0xe2, 0x00, 0x09, 0xea, 0xe7, 0xd9, 0x00, 0x00, 0x06, 0x96, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x1d, 0x96, 0xa9, 0x20, 0x00, 0x08, 0xe6, 0xea, 0xcc, 0x00, 0x01, 0xd9, 0xac, 0x05, 0xf4, 0x00, 0x8e, 0x2b, 0xb0, 0x4f, 0x50, 0x1d, 0x90, 0x9d, 0x17, 0xe2, 0x08, 0xe2, 0x02, 0xce, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x06, 0x73, 0x00, 0x00, 0x00, 0xbe, 0xee, 0x60, 0x00, 0x06, 0xf7, 0x1c, 0xb0, 0x00, 0x06, 0xf4, 0x0b, 0xc0, 0x00, 0x03, 0xe8, 0x5e, 0x90, 0x00, 0x00, 0xbf, 0xec, 0x10, 0x00, 0x00, 0x9f, 0xf2, 0x00, 0x00, 0x08, 0xfc, 0xe9, 0x06, 0xe5, 0x3e, 0xb0, 0x9e, 0x7a, 0xe0, 0x7f, 0x50, 0x0b, 0xef, 0xa0, 0x7f, 0x60, 0x02, 0xff, 0x40, 0x3e, 0xd6, 0x6c, 0xff, 0xb0, 0x07, 0xef, 0xfd, 0x68, 0xf9, 0x00, 0x14, 0x40, 0x00, 0x00, 0x44, 0xcd, 0xbd, 0xac, 0x9b, 0x45, 0x00, 0x15, 0x20, 0x0a, 0xd2, 0x06, 0xe7, 0x00, 0xbd, 0x00, 0x2e, 0xa0, 0x07, 0xf6, 0x00, 0x9f, 0x20, 0x0a, 0xe0, 0x00, 0xbe, 0x00, 0x0a, 0xe1, 0x00, 0x9f, 0x40, 0x05, 0xf8, 0x00, 0x1e, 0xb0, 0x00, 0x9e, 0x30, 0x02, 0xda, 0x00, 0x06, 0xc3, 0x05, 0x20, 0x00, 0xcc, 0x00, 0x04, 0xe9, 0x00, 0x0c, 0xd0, 0x00, 0x7f, 0x60, 0x03, 0xe9, 0x00, 0x0d, 0xb0, 0x00, 0xdc, 0x00, 0x0c, 0xc0, 0x00, 0xdc, 0x00, 0x0e, 0xb0, 0x05, 0xf8, 0x00, 0x9e, 0x30, 0x0d, 0xb0, 0x08, 0xe5, 0x01, 0xb8, 0x00, 0x00, 0x08, 0xa0, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x46, 0x19, 0xb0, 0x66, 0x8e, 0xed, 0xee, 0xfb, 0x01, 0x6e, 0xe9, 0x30, 0x01, 0xcc, 0xae, 0x30, 0x06, 0xe5, 0x2e, 0xa0, 0x00, 0x40, 0x04, 0x00, 0x00, 0x09, 0xc0, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x8b, 0xbd, 0xeb, 0xba, 0x8b, 0xbd, 0xeb, 0xba, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0x09, 0xc0, 0x00, 0x04, 0x53, 0x0b, 0xf7, 0x0d, 0xe2, 0x1e, 0xb0, 0x6f, 0x60, 0x48, 0x00, 0x47, 0x77, 0x75, 0x9f, 0xff, 0xfb, 0x24, 0x44, 0x43, 0x23, 0x0d, 0xe3, 0xde, 0x32, 0x30, 0x00, 0x00, 0x25, 0x10, 0x00, 0x0a, 0xe1, 0x00, 0x01, 0xea, 0x00, 0x00, 0x7f, 0x50, 0x00, 0x0c, 0xc0, 0x00, 0x04, 0xe8, 0x00, 0x00, 0x9e, 0x20, 0x00, 0x0d, 0xb0, 0x00, 0x06, 0xf6, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x2e, 0x90, 0x00, 0x08, 0xe3, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x26, 0x63, 0x00, 0x00, 0x7e, 0xff, 0xe9, 0x00, 0x4e, 0xc4, 0x4c, 0xf7, 0x0a, 0xe2, 0x00, 0xcf, 0xc0, 0xcc, 0x00, 0x8e, 0xbe, 0x1e, 0xa0, 0x2e, 0xb7, 0xf4, 0xe9, 0x0a, 0xe3, 0x6f, 0x5e, 0x95, 0xe8, 0x06, 0xf5, 0xea, 0xcd, 0x10, 0x7f, 0x4c, 0xfe, 0x60, 0x09, 0xe0, 0x9f, 0xc0, 0x01, 0xdc, 0x03, 0xed, 0x76, 0xbe, 0x60, 0x05, 0xdf, 0xfe, 0x80, 0x00, 0x00, 0x34, 0x10, 0x00, 0x00, 0x01, 0x42, 0x00, 0x01, 0x8d, 0xf7, 0x00, 0x4d, 0xec, 0xf7, 0x00, 0x1a, 0x45, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x00, 0x05, 0xf7, 0x00, 0x02, 0x48, 0xf9, 0x42, 0x0c, 0xff, 0xff, 0xfd, 0x00, 0x36, 0x73, 0x00, 0x04, 0xbe, 0xff, 0xea, 0x00, 0x8e, 0x83, 0x4b, 0xf7, 0x00, 0x20, 0x00, 0x1e, 0xa0, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x6f, 0x80, 0x00, 0x00, 0x1d, 0xd2, 0x00, 0x00, 0x0b, 0xe6, 0x00, 0x00, 0x0a, 0xe8, 0x00, 0x00, 0x0a, 0xe8, 0x00, 0x00, 0x0b, 0xe8, 0x00, 0x00, 0x0a, 0xfc, 0x88, 0x88, 0x84, 0xdf, 0xff, 0xff, 0xff, 0x70, 0x00, 0x47, 0x73, 0x00, 0x6c, 0xff, 0xfe, 0xa0, 0x7c, 0x73, 0x4b, 0xf7, 0x00, 0x00, 0x03, 0xfa, 0x00, 0x00, 0x04, 0xf9, 0x00, 0x00, 0x5c, 0xd3, 0x00, 0xee, 0xfb, 0x30, 0x00, 0x89, 0xad, 0xd5, 0x00, 0x00, 0x02, 0xdc, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x01, 0xdd, 0xba, 0x76, 0x7c, 0xf8, 0x9e, 0xff, 0xfd, 0x80, 0x00, 0x35, 0x30, 0x00, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x00, 0x0b, 0xfb, 0x00, 0x00, 0x00, 0x6e, 0xeb, 0x00, 0x00, 0x01, 0xdb, 0xdb, 0x00, 0x00, 0x09, 0xe3, 0xdb, 0x00, 0x00, 0x3e, 0x90, 0xdb, 0x00, 0x00, 0xbd, 0x10, 0xdb, 0x00, 0x06, 0xe6, 0x00, 0xdb, 0x00, 0x1d, 0xb2, 0x22, 0xdb, 0x21, 0x5f, 0xff, 0xff, 0xff, 0xf8, 0x27, 0x77, 0x77, 0xec, 0x74, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x04, 0x55, 0x55, 0x51, 0x0e, 0xff, 0xff, 0xf4, 0x2f, 0xa6, 0x66, 0x62, 0x4f, 0x70, 0x00, 0x00, 0x6f, 0x50, 0x00, 0x00, 0x7f, 0x99, 0x85, 0x00, 0x7e, 0xdd, 0xef, 0xb0, 0x01, 0x00, 0x2a, 0xf9, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x03, 0xeb, 0xa9, 0x76, 0x8d, 0xe5, 0x8e, 0xff, 0xed, 0x60, 0x00, 0x35, 0x30, 0x00, 0x00, 0x01, 0x67, 0x62, 0x00, 0x19, 0xef, 0xff, 0x50, 0x0a, 0xea, 0x41, 0x22, 0x05, 0xf9, 0x00, 0x00, 0x00, 0xae, 0x20, 0x00, 0x00, 0x0d, 0xc4, 0xab, 0xa5, 0x00, 0xdc, 0xeb, 0xad, 0xe8, 0x0e, 0xe5, 0x00, 0x1c, 0xe0, 0xeb, 0x00, 0x00, 0x8f, 0x4d, 0xb0, 0x00, 0x08, 0xf5, 0xae, 0x30, 0x00, 0xae, 0x14, 0xed, 0x65, 0x9e, 0xa0, 0x06, 0xdf, 0xfe, 0xa1, 0x00, 0x00, 0x44, 0x20, 0x00, 0x45, 0x55, 0x55, 0x55, 0x1e, 0xff, 0xff, 0xff, 0xf5, 0x66, 0x66, 0x66, 0xbe, 0x20, 0x00, 0x00, 0x1e, 0xb0, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x6f, 0x70, 0x00, 0x00, 0x0b, 0xd1, 0x00, 0x00, 0x04, 0xe9, 0x00, 0x00, 0x00, 0xae, 0x30, 0x00, 0x00, 0x2e, 0xb0, 0x00, 0x00, 0x08, 0xf6, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x26, 0x74, 0x00, 0x00, 0x9e, 0xfe, 0xeb, 0x10, 0x6f, 0xa2, 0x29, 0xf9, 0x09, 0xf3, 0x00, 0x0e, 0xb0, 0x7f, 0x70, 0x04, 0xe9, 0x00, 0xce, 0x86, 0xdd, 0x20, 0x01, 0xcf, 0xfc, 0x20, 0x00, 0xbe, 0x9a, 0xec, 0x10, 0x9e, 0x60, 0x05, 0xeb, 0x0d, 0xc0, 0x00, 0x0a, 0xe0, 0xcd, 0x00, 0x00, 0xbe, 0x09, 0xfa, 0x54, 0x9e, 0xa0, 0x0a, 0xef, 0xfe, 0xa1, 0x00, 0x01, 0x44, 0x10, 0x00, 0x00, 0x37, 0x73, 0x00, 0x00, 0xae, 0xff, 0xe9, 0x00, 0x9f, 0x92, 0x2a, 0xf7, 0x0d, 0xc0, 0x00, 0x0c, 0xc0, 0xea, 0x00, 0x00, 0x9e, 0x2d, 0xb0, 0x00, 0x09, 0xf4, 0xbe, 0x40, 0x04, 0xef, 0x53, 0xde, 0xcc, 0xeb, 0xf4, 0x01, 0x8a, 0x94, 0xae, 0x10, 0x00, 0x00, 0x0d, 0xc0, 0x00, 0x00, 0x08, 0xf8, 0x00, 0x55, 0x6a, 0xec, 0x00, 0x0d, 0xff, 0xea, 0x10, 0x00, 0x35, 0x40, 0x00, 0x00, 0x45, 0x0d, 0xe3, 0xce, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x30, 0xde, 0x2d, 0xe3, 0x23, 0x00, 0x01, 0x61, 0x0a, 0xf9, 0x08, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x53, 0x0b, 0xf7, 0x0d, 0xe2, 0x1e, 0xb0, 0x6f, 0x60, 0x48, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x05, 0xcc, 0x00, 0x03, 0xae, 0xb4, 0x01, 0x9e, 0xc5, 0x00, 0x6d, 0xd7, 0x00, 0x00, 0x7e, 0xd7, 0x00, 0x00, 0x03, 0xae, 0xd8, 0x10, 0x00, 0x02, 0x9e, 0xd7, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x67, 0x77, 0x77, 0x77, 0x0d, 0xff, 0xff, 0xff, 0xf1, 0x33, 0x33, 0x33, 0x33, 0x02, 0x22, 0x22, 0x22, 0x20, 0xdf, 0xff, 0xff, 0xff, 0x17, 0x77, 0x77, 0x77, 0x70, 0x40, 0x00, 0x00, 0x00, 0x9d, 0x60, 0x00, 0x00, 0x2a, 0xec, 0x50, 0x00, 0x00, 0x4b, 0xea, 0x30, 0x00, 0x00, 0x5c, 0xe8, 0x00, 0x00, 0x6c, 0xe9, 0x00, 0x6c, 0xeb, 0x40, 0x5c, 0xeb, 0x40, 0x00, 0x9a, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x73, 0x00, 0x6d, 0xff, 0xfe, 0xb1, 0x3b, 0x74, 0x39, 0xf9, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x09, 0xe6, 0x00, 0x01, 0xae, 0x80, 0x00, 0x0a, 0xe7, 0x00, 0x00, 0x1e, 0x90, 0x00, 0x00, 0x2a, 0x40, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7f, 0xa0, 0x00, 0x00, 0x7f, 0xa0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x24, 0x10, 0x00, 0x00, 0x5c, 0xef, 0xea, 0x10, 0x05, 0xeb, 0x41, 0x6d, 0xb0, 0x0c, 0xb0, 0x00, 0x03, 0xe7, 0x6e, 0x34, 0xbd, 0xc7, 0xab, 0xac, 0x1d, 0xc7, 0xda, 0x7d, 0xba, 0x7f, 0x40, 0xd9, 0x6e, 0xc9, 0x9e, 0x00, 0xe9, 0x6e, 0xc9, 0x9e, 0x01, 0xe8, 0x7d, 0xba, 0x6e, 0x57, 0xea, 0xaa, 0x9d, 0x0b, 0xee, 0x5e, 0xe4, 0x4e, 0x60, 0x32, 0x03, 0x20, 0x0a, 0xe5, 0x00, 0x01, 0x30, 0x00, 0xae, 0xdb, 0xce, 0x90, 0x00, 0x04, 0x8a, 0x95, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0xef, 0x40, 0x00, 0x00, 0x07, 0xee, 0x90, 0x00, 0x00, 0x0b, 0xdb, 0xd0, 0x00, 0x00, 0x1e, 0xa8, 0xe4, 0x00, 0x00, 0x6f, 0x62, 0xe9, 0x00, 0x00, 0xae, 0x00, 0xcc, 0x00, 0x00, 0xdb, 0x33, 0xae, 0x30, 0x06, 0xff, 0xff, 0xff, 0x80, 0x0a, 0xf7, 0x77, 0x7e, 0xc0, 0x0d, 0xb0, 0x00, 0x0a, 0xe3, 0x5f, 0x80, 0x00, 0x05, 0xf8, 0xae, 0x30, 0x00, 0x00, 0xdc, 0x25, 0x54, 0x30, 0x00, 0x08, 0xff, 0xff, 0xeb, 0x30, 0x8f, 0x65, 0x6a, 0xeb, 0x08, 0xf3, 0x00, 0x0c, 0xe0, 0x8f, 0x30, 0x00, 0xcd, 0x08, 0xf3, 0x02, 0x8e, 0x90, 0x8f, 0xff, 0xfe, 0x80, 0x08, 0xf8, 0x88, 0xbe, 0xa0, 0x8f, 0x30, 0x00, 0xae, 0x48, 0xf3, 0x00, 0x08, 0xf6, 0x8f, 0x30, 0x00, 0xaf, 0x48, 0xf8, 0x88, 0xbe, 0xb0, 0x8f, 0xff, 0xed, 0xa2, 0x00, 0x00, 0x02, 0x67, 0x51, 0x00, 0x1a, 0xef, 0xff, 0xe5, 0x0b, 0xea, 0x53, 0x69, 0x06, 0xfa, 0x00, 0x00, 0x00, 0xae, 0x30, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x0a, 0xe3, 0x00, 0x00, 0x00, 0x5e, 0xb0, 0x00, 0x00, 0x00, 0xaf, 0xc8, 0x78, 0xa0, 0x00, 0x9e, 0xff, 0xeb, 0x00, 0x00, 0x03, 0x52, 0x00, 0x45, 0x54, 0x00, 0x00, 0x0d, 0xff, 0xfe, 0xb4, 0x00, 0xdc, 0x56, 0x9e, 0xe4, 0x0d, 0xc0, 0x00, 0x4e, 0xc0, 0xdc, 0x00, 0x00, 0xae, 0x4d, 0xc0, 0x00, 0x06, 0xf7, 0xdc, 0x00, 0x00, 0x5f, 0x9d, 0xc0, 0x00, 0x05, 0xf8, 0xdc, 0x00, 0x00, 0x7f, 0x7d, 0xc0, 0x00, 0x0b, 0xe2, 0xdc, 0x00, 0x07, 0xeb, 0x0d, 0xd8, 0x9b, 0xec, 0x20, 0xdf, 0xfe, 0xd9, 0x10, 0x00, 0x25, 0x55, 0x55, 0x54, 0x8f, 0xff, 0xff, 0xfc, 0x8f, 0x86, 0x66, 0x65, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x51, 0x11, 0x10, 0x8f, 0xff, 0xff, 0xf9, 0x8f, 0x98, 0x88, 0x85, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x98, 0x88, 0x87, 0x8f, 0xff, 0xff, 0xfc, 0x25, 0x55, 0x55, 0x54, 0x8f, 0xff, 0xff, 0xfc, 0x8f, 0x86, 0x66, 0x65, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0xba, 0xaa, 0xa6, 0x8f, 0xdd, 0xdd, 0xd8, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x00, 0x00, 0x46, 0x64, 0x00, 0x00, 0x4c, 0xef, 0xfe, 0xb0, 0x03, 0xde, 0x94, 0x48, 0x70, 0x0a, 0xe6, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0x4f, 0x90, 0x00, 0x00, 0x00, 0x5f, 0x80, 0x07, 0x99, 0x90, 0x6f, 0x80, 0x0b, 0xee, 0xf1, 0x4f, 0x90, 0x00, 0x09, 0xf1, 0x1e, 0xc0, 0x00, 0x09, 0xf1, 0x0b, 0xe6, 0x00, 0x09, 0xf1, 0x04, 0xee, 0x96, 0x6c, 0xf1, 0x00, 0x4c, 0xef, 0xfe, 0xc1, 0x00, 0x00, 0x24, 0x41, 0x00, 0x44, 0x00, 0x00, 0x35, 0x0d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc1, 0x11, 0x1a, 0xf1, 0xdf, 0xff, 0xff, 0xff, 0x1d, 0xd8, 0x88, 0x8c, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x10, 0x15, 0x55, 0x55, 0x52, 0x4e, 0xff, 0xff, 0xe7, 0x00, 0x3c, 0xd3, 0x10, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x04, 0x6c, 0xe6, 0x41, 0x4f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x03, 0x40, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x0b, 0xe0, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x0b, 0xe0, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x0b, 0xe0, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x0b, 0xe0, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x1d, 0xc6, 0xa7, 0x7b, 0xf9, 0x6e, 0xff, 0xea, 0x10, 0x04, 0x52, 0x00, 0x44, 0x00, 0x00, 0x35, 0x1d, 0xc0, 0x00, 0x4e, 0xc0, 0xdc, 0x00, 0x1c, 0xe3, 0x0d, 0xc0, 0x0a, 0xe7, 0x00, 0xdc, 0x07, 0xea, 0x00, 0x0d, 0xc4, 0xec, 0x10, 0x00, 0xdc, 0xcf, 0x70, 0x00, 0x0d, 0xee, 0xdd, 0x10, 0x00, 0xde, 0x56, 0xea, 0x00, 0x0d, 0xc0, 0x0b, 0xe5, 0x00, 0xdc, 0x00, 0x3e, 0xc0, 0x0d, 0xc0, 0x00, 0x8f, 0x80, 0xdc, 0x00, 0x00, 0xce, 0x30, 0x05, 0x30, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x2f, 0xc9, 0x99, 0x97, 0x2f, 0xff, 0xff, 0xfc, 0x15, 0x51, 0x00, 0x04, 0x52, 0x5f, 0xf6, 0x00, 0x3e, 0xf8, 0x5f, 0xea, 0x00, 0x8e, 0xe8, 0x5f, 0xcd, 0x00, 0xbc, 0xe8, 0x5f, 0xae, 0x30, 0xe9, 0xf8, 0x5f, 0x7e, 0x85, 0xf6, 0xf8, 0x5f, 0x7b, 0xb9, 0xd4, 0xf8, 0x5f, 0x78, 0xec, 0xa4, 0xf8, 0x5f, 0x73, 0xef, 0x64, 0xf8, 0x5f, 0x70, 0xce, 0x14, 0xf8, 0x5f, 0x70, 0x00, 0x04, 0xf8, 0x5f, 0x70, 0x00, 0x04, 0xf8, 0x5f, 0x70, 0x00, 0x04, 0xf8, 0x45, 0x20, 0x00, 0x35, 0x0d, 0xfa, 0x00, 0x09, 0xf1, 0xde, 0xe1, 0x00, 0x9f, 0x1d, 0xbe, 0x80, 0x09, 0xf1, 0xdb, 0xbd, 0x00, 0x9f, 0x1d, 0xb5, 0xe6, 0x09, 0xf1, 0xdc, 0x0c, 0xc0, 0x9f, 0x1d, 0xc0, 0x7e, 0x49, 0xf1, 0xdc, 0x00, 0xda, 0x9f, 0x1d, 0xc0, 0x08, 0xe9, 0xf1, 0xdc, 0x00, 0x2e, 0xdf, 0x1d, 0xc0, 0x00, 0xaf, 0xf1, 0xdc, 0x00, 0x03, 0xef, 0x10, 0x00, 0x03, 0x77, 0x40, 0x00, 0x00, 0x8e, 0xff, 0xea, 0x00, 0x06, 0xeb, 0x43, 0x9f, 0x90, 0x0c, 0xe1, 0x00, 0x0c, 0xe0, 0x1e, 0xa0, 0x00, 0x08, 0xf5, 0x4f, 0x90, 0x00, 0x06, 0xf8, 0x6f, 0x80, 0x00, 0x05, 0xf9, 0x5f, 0x80, 0x00, 0x05, 0xf9, 0x3f, 0x90, 0x00, 0x06, 0xf8, 0x0e, 0xb0, 0x00, 0x09, 0xf5, 0x0b, 0xe3, 0x00, 0x0d, 0xd0, 0x05, 0xed, 0x76, 0xbf, 0x70, 0x00, 0x7d, 0xff, 0xe8, 0x00, 0x00, 0x00, 0x44, 0x10, 0x00, 0x25, 0x55, 0x41, 0x00, 0x08, 0xff, 0xff, 0xec, 0x30, 0x8f, 0x75, 0x69, 0xec, 0x08, 0xf5, 0x00, 0x0a, 0xf4, 0x8f, 0x50, 0x00, 0x8f, 0x68, 0xf5, 0x00, 0x09, 0xf4, 0x8f, 0x50, 0x38, 0xec, 0x08, 0xff, 0xff, 0xfc, 0x30, 0x8f, 0x98, 0x74, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x40, 0x00, 0x00, 0x8e, 0xff, 0xea, 0x00, 0x06, 0xeb, 0x43, 0x9f, 0x90, 0x0c, 0xe1, 0x00, 0x0c, 0xe0, 0x1e, 0xa0, 0x00, 0x08, 0xf5, 0x4f, 0x90, 0x00, 0x06, 0xf8, 0x6f, 0x80, 0x00, 0x05, 0xf9, 0x5f, 0x80, 0x00, 0x05, 0xf9, 0x3f, 0x90, 0x00, 0x06, 0xf8, 0x0e, 0xb0, 0x00, 0x09, 0xf5, 0x0b, 0xe3, 0x00, 0x0d, 0xd0, 0x05, 0xed, 0x76, 0xdf, 0x70, 0x00, 0x7d, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x44, 0xdd, 0x10, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x0d, 0xd1, 0x00, 0x00, 0x00, 0x02, 0x31, 0x25, 0x54, 0x20, 0x00, 0x08, 0xff, 0xff, 0xd8, 0x00, 0x8f, 0x76, 0x7c, 0xe7, 0x08, 0xf5, 0x00, 0x2e, 0xb0, 0x8f, 0x50, 0x00, 0xec, 0x08, 0xf5, 0x00, 0x4e, 0xa0, 0x8f, 0x87, 0x9d, 0xd3, 0x08, 0xff, 0xff, 0xc3, 0x00, 0x8f, 0x52, 0xce, 0x30, 0x08, 0xf5, 0x04, 0xea, 0x00, 0x8f, 0x50, 0x0a, 0xe5, 0x08, 0xf5, 0x00, 0x2d, 0xc0, 0x8f, 0x50, 0x00, 0x8f, 0x80, 0x00, 0x16, 0x76, 0x30, 0x06, 0xdf, 0xff, 0xea, 0x2e, 0xd7, 0x35, 0x86, 0x6f, 0x80, 0x00, 0x00, 0x6f, 0x90, 0x00, 0x00, 0x1d, 0xe8, 0x10, 0x00, 0x04, 0xcf, 0xd8, 0x10, 0x00, 0x07, 0xcf, 0xd4, 0x00, 0x00, 0x07, 0xec, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xce, 0x9a, 0x75, 0x6a, 0xfa, 0x8e, 0xff, 0xfe, 0x91, 0x00, 0x25, 0x41, 0x00, 0x25, 0x55, 0x55, 0x55, 0x53, 0x6f, 0xff, 0xff, 0xff, 0xf9, 0x26, 0x66, 0xce, 0x66, 0x64, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x44, 0x00, 0x00, 0x35, 0x0d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1d, 0xc0, 0x00, 0x0a, 0xf1, 0xdc, 0x00, 0x00, 0xaf, 0x1c, 0xd0, 0x00, 0x0b, 0xe0, 0xbe, 0x30, 0x00, 0xdc, 0x06, 0xec, 0x76, 0xbf, 0x80, 0x08, 0xef, 0xfe, 0x90, 0x00, 0x01, 0x44, 0x10, 0x00, 0x35, 0x00, 0x00, 0x00, 0x44, 0x8f, 0x60, 0x00, 0x02, 0xeb, 0x3e, 0xa0, 0x00, 0x07, 0xf7, 0x0c, 0xd0, 0x00, 0x0b, 0xe1, 0x09, 0xf4, 0x00, 0x0e, 0xb0, 0x04, 0xe9, 0x00, 0x6f, 0x70, 0x00, 0xcc, 0x00, 0xae, 0x20, 0x00, 0x9e, 0x20, 0xdc, 0x00, 0x00, 0x4f, 0x73, 0xe8, 0x00, 0x00, 0x0d, 0xb8, 0xe3, 0x00, 0x00, 0x09, 0xdb, 0xc0, 0x00, 0x00, 0x05, 0xfe, 0x90, 0x00, 0x00, 0x00, 0xde, 0x40, 0x00, 0x34, 0x00, 0x00, 0x00, 0x34, 0xae, 0x00, 0x00, 0x00, 0xcc, 0x8e, 0x00, 0x00, 0x00, 0xdb, 0x7f, 0x30, 0x33, 0x00, 0xda, 0x5f, 0x50, 0xce, 0x10, 0xe9, 0x3f, 0x71, 0xee, 0x62, 0xf7, 0x0e, 0x86, 0xeb, 0x94, 0xf6, 0x0d, 0x99, 0xc9, 0xc6, 0xf4, 0x0c, 0xac, 0x95, 0xe7, 0xe1, 0x0b, 0xbe, 0x60, 0xea, 0xe0, 0x0a, 0xde, 0x10, 0xcc, 0xd0, 0x08, 0xec, 0x00, 0x9e, 0xc0, 0x07, 0xfa, 0x00, 0x6f, 0xb0, 0x15, 0x30, 0x00, 0x02, 0x52, 0x0c, 0xd1, 0x00, 0x0b, 0xe2, 0x05, 0xe9, 0x00, 0x6e, 0x80, 0x00, 0xae, 0x20, 0xcc, 0x00, 0x00, 0x2e, 0xa8, 0xe5, 0x00, 0x00, 0x08, 0xee, 0xb0, 0x00, 0x00, 0x00, 0xde, 0x30, 0x00, 0x00, 0x04, 0xef, 0x70, 0x00, 0x00, 0x0c, 0xdb, 0xd2, 0x00, 0x00, 0x7f, 0x63, 0xea, 0x00, 0x02, 0xdb, 0x00, 0x9e, 0x40, 0x0a, 0xe4, 0x00, 0x1d, 0xc0, 0x4e, 0xa0, 0x00, 0x07, 0xf7, 0x25, 0x20, 0x00, 0x01, 0x53, 0x4e, 0xb0, 0x00, 0x08, 0xf7, 0x0b, 0xe3, 0x00, 0x0d, 0xc0, 0x04, 0xea, 0x00, 0x7f, 0x70, 0x00, 0xae, 0x20, 0xcc, 0x00, 0x00, 0x3e, 0x95, 0xf6, 0x00, 0x00, 0x0a, 0xdc, 0xc0, 0x00, 0x00, 0x03, 0xef, 0x60, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x05, 0x55, 0x55, 0x53, 0x2f, 0xff, 0xff, 0xfb, 0x15, 0x55, 0x58, 0xf8, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x7f, 0x60, 0x00, 0x01, 0xdc, 0x00, 0x00, 0x09, 0xe4, 0x00, 0x00, 0x3e, 0xa0, 0x00, 0x00, 0xae, 0x30, 0x00, 0x04, 0xe9, 0x00, 0x00, 0x0b, 0xd2, 0x00, 0x00, 0x6f, 0xb8, 0x88, 0x86, 0x8f, 0xff, 0xff, 0xfb, 0x45, 0x54, 0xef, 0xfe, 0xeb, 0x33, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xea, 0x00, 0xed, 0xaa, 0xbc, 0xcb, 0x43, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x00, 0x8e, 0x40, 0x00, 0x01, 0xea, 0x00, 0x00, 0x0a, 0xe1, 0x00, 0x00, 0x5f, 0x70, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x09, 0xe3, 0x00, 0x00, 0x3e, 0x90, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x0d, 0xb0, 0x00, 0x00, 0xae, 0x20, 0x45, 0x55, 0x1c, 0xff, 0xf4, 0x23, 0x8f, 0x40, 0x08, 0xf4, 0x00, 0x8f, 0x40, 0x08, 0xf4, 0x00, 0x8f, 0x40, 0x08, 0xf4, 0x00, 0x8f, 0x40, 0x08, 0xf4, 0x00, 0x8f, 0x40, 0x08, 0xf4, 0x00, 0x8f, 0x40, 0x08, 0xf4, 0x8a, 0xcf, 0x4a, 0xcc, 0xc3, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0xdc, 0x00, 0x00, 0x00, 0x08, 0xde, 0x60, 0x00, 0x00, 0x0d, 0x9a, 0xc0, 0x00, 0x00, 0x7e, 0x22, 0xe7, 0x00, 0x00, 0xca, 0x00, 0x9d, 0x00, 0x06, 0xe3, 0x00, 0x2e, 0x80, 0x0c, 0xb0, 0x00, 0x09, 0xd1, 0x19, 0x40, 0x00, 0x02, 0x94, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x5b, 0xbb, 0xbb, 0xbb, 0xbb, 0xb4, 0x11, 0x00, 0xaf, 0x70, 0x1b, 0xd2, 0x01, 0xa8, 0x00, 0x36, 0x63, 0x00, 0x2c, 0xee, 0xee, 0xb0, 0x09, 0x62, 0x18, 0xe8, 0x00, 0x00, 0x00, 0xdb, 0x01, 0x69, 0xaa, 0xdc, 0x4d, 0xec, 0xbb, 0xdc, 0xbe, 0x40, 0x00, 0xcc, 0xdc, 0x00, 0x02, 0xec, 0xbe, 0x74, 0x6c, 0xec, 0x3c, 0xff, 0xe8, 0xbc, 0x00, 0x34, 0x10, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x0b, 0xd0, 0x46, 0x50, 0x00, 0xbd, 0xbe, 0xef, 0xc2, 0x0b, 0xed, 0x51, 0x8e, 0xb0, 0xbf, 0x50, 0x00, 0xbe, 0x2b, 0xe0, 0x00, 0x08, 0xf6, 0xbd, 0x00, 0x00, 0x7f, 0x6b, 0xe0, 0x00, 0x09, 0xf5, 0xbf, 0x60, 0x00, 0xce, 0x1b, 0xed, 0x74, 0x9e, 0xa0, 0xbb, 0x9e, 0xfe, 0xb1, 0x00, 0x00, 0x25, 0x20, 0x00, 0x00, 0x04, 0x66, 0x30, 0x04, 0xce, 0xff, 0xe8, 0x1d, 0xe8, 0x44, 0x84, 0x7f, 0x80, 0x00, 0x00, 0x9f, 0x40, 0x00, 0x00, 0xaf, 0x20, 0x00, 0x00, 0x9f, 0x40, 0x00, 0x00, 0x7f, 0x90, 0x00, 0x00, 0x1d, 0xe9, 0x56, 0x87, 0x03, 0xbe, 0xff, 0xe8, 0x00, 0x02, 0x54, 0x10, 0x00, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x36, 0x50, 0xcd, 0x01, 0xbe, 0xee, 0xcc, 0xd0, 0x9f, 0xa3, 0x2b, 0xed, 0x0d, 0xd1, 0x00, 0x2e, 0xd0, 0xeb, 0x00, 0x00, 0xdd, 0x2f, 0xa0, 0x00, 0x0c, 0xd0, 0xeb, 0x00, 0x00, 0xcd, 0x0d, 0xd0, 0x00, 0x2e, 0xd0, 0x8f, 0xb5, 0x5c, 0xed, 0x00, 0x9e, 0xfe, 0xba, 0xd0, 0x00, 0x25, 0x20, 0x00, 0x00, 0x15, 0x64, 0x00, 0x00, 0x7d, 0xfe, 0xeb, 0x20, 0x5e, 0xc4, 0x07, 0xea, 0x0b, 0xe2, 0x00, 0x0b, 0xe1, 0xed, 0xaa, 0xaa, 0xcf, 0x4e, 0xec, 0xcc, 0xcc, 0xc4, 0xdb, 0x00, 0x00, 0x00, 0x0b, 0xe3, 0x00, 0x00, 0x00, 0x4e, 0xd7, 0x45, 0x8a, 0x00, 0x5c, 0xef, 0xfe, 0xa0, 0x00, 0x02, 0x53, 0x00, 0x00, 0x00, 0x03, 0xbe, 0xee, 0x90, 0x00, 0xbe, 0x97, 0x86, 0x00, 0x0d, 0xc0, 0x00, 0x00, 0x03, 0xeb, 0x44, 0x40, 0xde, 0xff, 0xff, 0xff, 0x34, 0x55, 0xec, 0x55, 0x51, 0x00, 0x0e, 0xb0, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, 0x00, 0x04, 0x75, 0x02, 0x30, 0x0a, 0xee, 0xec, 0xad, 0x08, 0xfa, 0x32, 0xaf, 0xd0, 0xcd, 0x00, 0x00, 0xdd, 0x0e, 0xb0, 0x00, 0x0b, 0xd2, 0xfa, 0x00, 0x00, 0xad, 0x0e, 0xb0, 0x00, 0x0b, 0xd0, 0xcd, 0x10, 0x00, 0xdd, 0x07, 0xfb, 0x55, 0xbe, 0xd0, 0x09, 0xef, 0xfc, 0xbd, 0x00, 0x01, 0x54, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0xdc, 0x09, 0x95, 0x35, 0xbf, 0x70, 0x8d, 0xff, 0xfe, 0x90, 0x00, 0x02, 0x54, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbe, 0x02, 0x65, 0x10, 0xbd, 0x8e, 0xef, 0xd4, 0xbe, 0xd5, 0x17, 0xeb, 0xbf, 0x60, 0x00, 0xcd, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0x00, 0x0a, 0xd4, 0x00, 0x00, 0x00, 0xcf, 0x60, 0x00, 0x00, 0x03, 0x50, 0x00, 0x02, 0x44, 0x44, 0x10, 0x00, 0x8e, 0xff, 0xf5, 0x00, 0x00, 0x13, 0x9f, 0x50, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x01, 0x45, 0xaf, 0x85, 0x30, 0xbf, 0xff, 0xff, 0xff, 0x50, 0x00, 0x03, 0xdb, 0x00, 0x05, 0xed, 0x00, 0x00, 0x52, 0x03, 0x44, 0x43, 0x0c, 0xff, 0xfc, 0x00, 0x24, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xeb, 0x85, 0x5a, 0xf8, 0xef, 0xfe, 0xa0, 0x14, 0x41, 0x00, 0x6e, 0x70, 0x00, 0x00, 0x06, 0xf7, 0x00, 0x00, 0x00, 0x6f, 0x70, 0x00, 0x00, 0x06, 0xf7, 0x00, 0x02, 0x42, 0x6f, 0x70, 0x03, 0xdd, 0x36, 0xf7, 0x02, 0xdd, 0x40, 0x6f, 0x71, 0xce, 0x40, 0x06, 0xf7, 0xbe, 0x50, 0x00, 0x6f, 0xce, 0xf8, 0x00, 0x06, 0xfd, 0x4b, 0xe4, 0x00, 0x6f, 0x80, 0x2d, 0xd1, 0x06, 0xf7, 0x00, 0x5e, 0xb0, 0x6f, 0x70, 0x00, 0x9f, 0x70, 0xae, 0xee, 0xe6, 0x00, 0x03, 0x67, 0xaf, 0x60, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x00, 0x7f, 0x60, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x00, 0x7f, 0x60, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x00, 0x7f, 0x60, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x00, 0x7f, 0x60, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x01, 0x45, 0xaf, 0x95, 0x30, 0xbf, 0xff, 0xff, 0xff, 0x50, 0x14, 0x06, 0x50, 0x36, 0x20, 0x5e, 0xaf, 0xe9, 0xef, 0xd1, 0x5f, 0xc4, 0xdf, 0x97, 0xf6, 0x5f, 0x80, 0xbe, 0x12, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x5f, 0x60, 0xad, 0x00, 0xf8, 0x33, 0x03, 0x65, 0x10, 0xbc, 0x9e, 0xef, 0xd4, 0xbe, 0xd5, 0x16, 0xeb, 0xbf, 0x50, 0x00, 0xcd, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0xbe, 0x00, 0x00, 0xbe, 0x00, 0x02, 0x66, 0x30, 0x00, 0x00, 0x9e, 0xfe, 0xea, 0x10, 0x07, 0xfa, 0x31, 0x9e, 0xa0, 0x0c, 0xd0, 0x00, 0x0b, 0xe1, 0x0e, 0xa0, 0x00, 0x08, 0xf5, 0x2f, 0x90, 0x00, 0x07, 0xf6, 0x0e, 0xa0, 0x00, 0x08, 0xf5, 0x0c, 0xd1, 0x00, 0x0c, 0xe1, 0x06, 0xeb, 0x54, 0xaf, 0x90, 0x00, 0x7d, 0xff, 0xe9, 0x00, 0x00, 0x00, 0x44, 0x10, 0x00, 0x33, 0x04, 0x65, 0x00, 0x0b, 0xca, 0xee, 0xfc, 0x30, 0xbe, 0xc4, 0x17, 0xeb, 0x0b, 0xf4, 0x00, 0x0b, 0xe2, 0xbe, 0x00, 0x00, 0x8f, 0x6b, 0xe0, 0x00, 0x07, 0xf6, 0xbe, 0x00, 0x00, 0x9f, 0x5b, 0xf6, 0x00, 0x0b, 0xe1, 0xbe, 0xd6, 0x49, 0xea, 0x0b, 0xd9, 0xef, 0xeb, 0x10, 0xbd, 0x01, 0x42, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x65, 0x02, 0x30, 0x0a, 0xee, 0xfc, 0xad, 0x08, 0xfa, 0x23, 0xbe, 0xd0, 0xdd, 0x00, 0x02, 0xed, 0x1e, 0xb0, 0x00, 0x0c, 0xd2, 0xfa, 0x00, 0x00, 0xcd, 0x0e, 0xb0, 0x00, 0x0c, 0xd0, 0xcd, 0x10, 0x02, 0xed, 0x08, 0xfb, 0x55, 0xce, 0xd0, 0x09, 0xef, 0xeb, 0xcd, 0x00, 0x02, 0x53, 0x0c, 0xd0, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x02, 0x30, 0x34, 0x44, 0x01, 0x66, 0x2b, 0xff, 0xf6, 0xdf, 0xfb, 0x02, 0x7f, 0xdb, 0x45, 0x50, 0x05, 0xfd, 0x10, 0x00, 0x00, 0x5f, 0xa0, 0x00, 0x00, 0x05, 0xf8, 0x00, 0x00, 0x00, 0x5f, 0x80, 0x00, 0x00, 0x05, 0xf8, 0x00, 0x00, 0x25, 0x8f, 0xa5, 0x30, 0x0e, 0xff, 0xff, 0xff, 0x20, 0x00, 0x16, 0x75, 0x10, 0x08, 0xef, 0xff, 0xe4, 0x0e, 0xc4, 0x14, 0x80, 0x1e, 0xb0, 0x00, 0x00, 0x0a, 0xfc, 0x60, 0x00, 0x00, 0x7c, 0xfd, 0x60, 0x00, 0x00, 0x6c, 0xe5, 0x00, 0x00, 0x05, 0xf8, 0x5a, 0x64, 0x5b, 0xf6, 0x4d, 0xff, 0xfe, 0x90, 0x00, 0x25, 0x41, 0x00, 0x00, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x2b, 0xe4, 0x44, 0x22, 0xef, 0xff, 0xff, 0xfa, 0x05, 0x5b, 0xe5, 0x55, 0x30, 0x00, 0xae, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0xaf, 0x30, 0x00, 0x00, 0x08, 0xfb, 0x44, 0x50, 0x00, 0x1b, 0xef, 0xfc, 0x00, 0x00, 0x01, 0x44, 0x10, 0x33, 0x00, 0x00, 0x33, 0xcd, 0x00, 0x00, 0xcd, 0xcd, 0x00, 0x00, 0xcd, 0xcd, 0x00, 0x00, 0xcd, 0xcd, 0x00, 0x00, 0xcd, 0xcd, 0x00, 0x00, 0xcd, 0xcd, 0x00, 0x00, 0xcd, 0xbe, 0x00, 0x02, 0xed, 0x9f, 0xa4, 0x5c, 0xed, 0x1b, 0xef, 0xea, 0xad, 0x00, 0x24, 0x20, 0x00, 0x14, 0x20, 0x00, 0x01, 0x42, 0x2e, 0xa0, 0x00, 0x08, 0xf5, 0x0b, 0xe0, 0x00, 0x0c, 0xd0, 0x07, 0xf6, 0x00, 0x3e, 0x90, 0x01, 0xeb, 0x00, 0x9e, 0x30, 0x00, 0xae, 0x10, 0xcc, 0x00, 0x00, 0x5f, 0x74, 0xe7, 0x00, 0x00, 0x0d, 0xb9, 0xe1, 0x00, 0x00, 0x09, 0xed, 0xb0, 0x00, 0x00, 0x03, 0xef, 0x60, 0x00, 0x33, 0x00, 0x00, 0x00, 0x24, 0xbd, 0x00, 0x00, 0x00, 0xad, 0x9e, 0x00, 0x78, 0x00, 0xcc, 0x7f, 0x32, 0xef, 0x50, 0xda, 0x5f, 0x67, 0xed, 0x92, 0xe8, 0x1e, 0x8b, 0xca, 0xc5, 0xf5, 0x0d, 0xad, 0x97, 0xe8, 0xe2, 0x0c, 0xbf, 0x52, 0xeb, 0xd0, 0x0a, 0xee, 0x00, 0xce, 0xc0, 0x08, 0xfb, 0x00, 0xaf, 0xa0, 0x04, 0x30, 0x00, 0x02, 0x41, 0x0b, 0xe4, 0x00, 0x2d, 0xd1, 0x02, 0xdd, 0x10, 0xbe, 0x40, 0x00, 0x5e, 0xa8, 0xf8, 0x00, 0x00, 0x09, 0xee, 0xb0, 0x00, 0x00, 0x02, 0xef, 0x50, 0x00, 0x00, 0x0b, 0xed, 0xd1, 0x00, 0x00, 0x8e, 0x75, 0xea, 0x00, 0x05, 0xea, 0x00, 0x8f, 0x70, 0x2d, 0xd2, 0x00, 0x0b, 0xe4, 0x14, 0x20, 0x00, 0x01, 0x42, 0x2e, 0xa0, 0x00, 0x08, 0xf5, 0x0a, 0xe1, 0x00, 0x0c, 0xd0, 0x05, 0xe7, 0x00, 0x2e, 0x90, 0x00, 0xcc, 0x00, 0x8e, 0x40, 0x00, 0x7e, 0x40, 0xcc, 0x00, 0x00, 0x1e, 0xa2, 0xe8, 0x00, 0x00, 0x0a, 0xd8, 0xe2, 0x00, 0x00, 0x03, 0xed, 0xb0, 0x00, 0x00, 0x00, 0xbf, 0x60, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x03, 0xe9, 0x00, 0x00, 0x03, 0x4b, 0xe2, 0x00, 0x00, 0x0e, 0xfe, 0x70, 0x00, 0x00, 0x03, 0x51, 0x00, 0x00, 0x00, 0x14, 0x44, 0x44, 0x42, 0x6f, 0xff, 0xff, 0xfa, 0x13, 0x33, 0x3a, 0xe6, 0x00, 0x00, 0x6e, 0x90, 0x00, 0x04, 0xeb, 0x00, 0x00, 0x1c, 0xd2, 0x00, 0x00, 0xae, 0x40, 0x00, 0x08, 0xe7, 0x00, 0x00, 0x5e, 0xc7, 0x77, 0x76, 0x9f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x13, 0x00, 0x0a, 0xed, 0x00, 0x8f, 0xa4, 0x00, 0xae, 0x10, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xbd, 0x00, 0x6b, 0xe9, 0x00, 0xbe, 0xb3, 0x00, 0x04, 0xdc, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0x9e, 0x40, 0x00, 0x4e, 0xd9, 0x00, 0x04, 0xaa, 0x9c, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0x22, 0x32, 0x00, 0x00, 0xbe, 0xb2, 0x00, 0x38, 0xea, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x7e, 0xb7, 0x00, 0x1a, 0xed, 0x00, 0xae, 0x60, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x00, 0x01, 0xec, 0x00, 0x8d, 0xe7, 0x00, 0x9a, 0x50, 0x00, 0x1b, 0xd9, 0x00, 0x5c, 0x8c, 0x6c, 0xc2, 0x9b, 0xb8, 0x02, 0xbe, 0xe4, 0x32, 0x00, 0x03, 0x20, ]; /// Glyph metadata for binary search pub const NOTO_SANS_MONO_17_REGULAR_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 10, data_offset: 0, }, GlyphInfo { character: '!', width: 3, height: 14, x_offset: 4, y_offset: 1, x_advance: 10, data_offset: 0, }, GlyphInfo { character: '"', width: 6, height: 6, x_offset: 2, y_offset: 1, x_advance: 10, data_offset: 21, }, GlyphInfo { character: '#', width: 10, height: 13, x_offset: 0, y_offset: 1, x_advance: 10, data_offset: 39, }, GlyphInfo { character: '$', width: 8, height: 14, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 104, }, GlyphInfo { character: '%', width: 11, height: 14, x_offset: 0, y_offset: 1, x_advance: 10, data_offset: 160, }, GlyphInfo { character: '&', width: 10, height: 14, x_offset: 0, y_offset: 1, x_advance: 10, data_offset: 237, }, GlyphInfo { character: '\'', width: 2, height: 6, x_offset: 4, y_offset: 1, x_advance: 10, data_offset: 307, }, GlyphInfo { character: '(', width: 5, height: 16, x_offset: 3, y_offset: 1, x_advance: 10, data_offset: 313, }, GlyphInfo { character: ')', width: 5, height: 16, x_offset: 2, y_offset: 1, x_advance: 10, data_offset: 353, }, GlyphInfo { character: '*', width: 8, height: 8, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 393, }, GlyphInfo { character: '+', width: 8, height: 8, x_offset: 1, y_offset: 4, x_advance: 10, data_offset: 425, }, GlyphInfo { character: ',', width: 4, height: 6, x_offset: 3, y_offset: 11, x_advance: 10, data_offset: 457, }, GlyphInfo { character: '-', width: 6, height: 3, x_offset: 2, y_offset: 8, x_advance: 10, data_offset: 469, }, GlyphInfo { character: '.', width: 3, height: 4, x_offset: 4, y_offset: 11, x_advance: 10, data_offset: 478, }, GlyphInfo { character: '/', width: 7, height: 13, x_offset: 2, y_offset: 1, x_advance: 10,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_14_regular.rs
frostsnap_fonts/src/noto_sans_mono_14_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 14px //! Weight: 400 //! Characters: 95 //! Line height: 15px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_14_REGULAR_DATA: &[u8] = &[ 0xae, 0x0a, 0xe0, 0xae, 0x09, 0xd0, 0x9d, 0x08, 0xd0, 0x8c, 0x02, 0x40, 0x8b, 0x0b, 0xe1, 0x02, 0x00, 0xca, 0x4f, 0x4b, 0x93, 0xf2, 0xb8, 0x0e, 0x07, 0x50, 0xa0, 0x00, 0x0d, 0x62, 0xe0, 0x00, 0x01, 0xe2, 0x6c, 0x00, 0x02, 0x5d, 0x29, 0xa2, 0x05, 0xee, 0xee, 0xee, 0xe4, 0x00, 0xa9, 0x0d, 0x50, 0x00, 0x0c, 0x62, 0xe1, 0x00, 0xbd, 0xed, 0xde, 0xda, 0x02, 0x6d, 0x39, 0xb3, 0x20, 0x07, 0xc0, 0xb8, 0x00, 0x00, 0xaa, 0x0d, 0x50, 0x00, 0x00, 0x68, 0x00, 0x00, 0x7c, 0xda, 0x60, 0x9e, 0xcd, 0xbb, 0x0d, 0x97, 0xb0, 0x00, 0xcb, 0x8b, 0x00, 0x06, 0xde, 0xc6, 0x00, 0x01, 0xae, 0xeb, 0x00, 0x07, 0xb4, 0xe6, 0x10, 0x7b, 0x3e, 0x5c, 0xcc, 0xde, 0xb0, 0x48, 0xbc, 0x60, 0x00, 0x07, 0x90, 0x00, 0x02, 0x20, 0x00, 0x00, 0x08, 0xdd, 0x80, 0x4e, 0x20, 0xe5, 0x5d, 0x0b, 0x90, 0x0e, 0x23, 0xe4, 0xe2, 0x00, 0xc9, 0x9c, 0xb9, 0x00, 0x03, 0xaa, 0x6e, 0x20, 0x00, 0x00, 0x0b, 0x98, 0xb6, 0x00, 0x04, 0xe8, 0xc7, 0xe4, 0x00, 0xb9, 0xa9, 0x0c, 0x80, 0x4e, 0x2a, 0xa0, 0xc7, 0x0b, 0xa0, 0x4d, 0xcc, 0x10, 0x00, 0x00, 0x03, 0x00, 0x00, 0x14, 0x10, 0x00, 0x00, 0x5e, 0xdd, 0x40, 0x00, 0x0a, 0xc0, 0xba, 0x00, 0x00, 0xab, 0x0c, 0xa0, 0x00, 0x05, 0xea, 0xe3, 0x00, 0x00, 0x1f, 0xf5, 0x00, 0x00, 0x0b, 0xde, 0xa0, 0xa9, 0x07, 0xe3, 0x4e, 0x8e, 0x70, 0x9d, 0x00, 0x7f, 0xe0, 0x07, 0xe6, 0x18, 0xff, 0x30, 0x0b, 0xee, 0xd6, 0xcc, 0x10, 0x03, 0x40, 0x00, 0x00, 0x9d, 0x8c, 0x7b, 0x48, 0x00, 0xac, 0x00, 0x4e, 0x50, 0x0a, 0xc0, 0x00, 0xd9, 0x00, 0x3f, 0x50, 0x05, 0xf4, 0x00, 0x5f, 0x30, 0x04, 0xf5, 0x00, 0x0e, 0x80, 0x00, 0xbb, 0x00, 0x06, 0xe3, 0x00, 0x0b, 0xa0, 0x00, 0x26, 0x00, 0x7d, 0x20, 0x0c, 0xa0, 0x07, 0xe2, 0x01, 0xe7, 0x00, 0xd9, 0x00, 0xca, 0x00, 0xca, 0x00, 0xc9, 0x01, 0xe7, 0x06, 0xe3, 0x0b, 0xb0, 0x5e, 0x40, 0x44, 0x00, 0x00, 0x57, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x77, 0x7b, 0x6a, 0x18, 0xbe, 0xec, 0xb3, 0x04, 0xdc, 0x90, 0x00, 0xca, 0x4e, 0x50, 0x02, 0x20, 0x40, 0x00, 0x00, 0x24, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x7c, 0x00, 0x08, 0x9b, 0xd9, 0x94, 0xaa, 0xcd, 0xaa, 0x50, 0x07, 0xc0, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0x60, 0x00, 0x07, 0xd5, 0x0a, 0xe1, 0x0c, 0xb0, 0x0e, 0x50, 0x78, 0x88, 0x4c, 0xdd, 0xd6, 0x8b, 0x0b, 0xe1, 0x02, 0x00, 0x00, 0x00, 0xca, 0x00, 0x03, 0xe5, 0x00, 0x09, 0xc0, 0x00, 0x0d, 0x80, 0x00, 0x6e, 0x20, 0x00, 0xbb, 0x00, 0x02, 0xe6, 0x00, 0x08, 0xd0, 0x00, 0x0c, 0x90, 0x00, 0x4e, 0x40, 0x00, 0x00, 0x02, 0x30, 0x00, 0x01, 0xbe, 0xed, 0x50, 0x0a, 0xd4, 0x2e, 0xe1, 0x0d, 0x80, 0x4e, 0xf7, 0x3f, 0x40, 0xbb, 0xc9, 0x4f, 0x26, 0xe3, 0xba, 0x4f, 0x3d, 0x90, 0xba, 0x2f, 0xad, 0x10, 0xc9, 0x0e, 0xf6, 0x01, 0xe7, 0x09, 0xf4, 0x2a, 0xe1, 0x01, 0xbe, 0xed, 0x60, 0x00, 0x02, 0x40, 0x00, 0x05, 0xce, 0x50, 0x08, 0xea, 0xf5, 0x00, 0x34, 0x1f, 0x50, 0x00, 0x02, 0xf5, 0x00, 0x00, 0x2f, 0x50, 0x00, 0x02, 0xf5, 0x00, 0x00, 0x2f, 0x50, 0x00, 0x02, 0xf5, 0x00, 0x00, 0x2f, 0x50, 0x04, 0xee, 0xff, 0xe6, 0x00, 0x02, 0x40, 0x00, 0x07, 0xdf, 0xed, 0x60, 0x0a, 0x92, 0x2b, 0xd0, 0x00, 0x00, 0x06, 0xf3, 0x00, 0x00, 0x07, 0xe1, 0x00, 0x00, 0x1d, 0xa0, 0x00, 0x00, 0xbd, 0x20, 0x00, 0x0a, 0xe4, 0x00, 0x00, 0xae, 0x50, 0x00, 0x0a, 0xe7, 0x44, 0x43, 0x1f, 0xff, 0xff, 0xfb, 0x00, 0x34, 0x00, 0x08, 0xdf, 0xed, 0x60, 0x88, 0x32, 0xbd, 0x00, 0x00, 0x07, 0xf1, 0x00, 0x01, 0xbc, 0x00, 0x8c, 0xeb, 0x30, 0x06, 0x8a, 0xdb, 0x00, 0x00, 0x04, 0xe6, 0x00, 0x00, 0x1e, 0x79, 0x41, 0x3a, 0xe3, 0xce, 0xef, 0xd7, 0x00, 0x24, 0x30, 0x00, 0x00, 0x00, 0x12, 0x10, 0x00, 0x00, 0xaf, 0x60, 0x00, 0x05, 0xee, 0x60, 0x00, 0x0c, 0x9e, 0x60, 0x00, 0x8d, 0x1e, 0x60, 0x02, 0xe6, 0x0e, 0x60, 0x0a, 0xb0, 0x0e, 0x60, 0x5e, 0x97, 0x7e, 0xa6, 0x6c, 0xcc, 0xce, 0xda, 0x00, 0x00, 0x0e, 0x60, 0x00, 0x00, 0x0e, 0x60, 0x8f, 0xff, 0xfc, 0x09, 0xc4, 0x44, 0x30, 0xab, 0x00, 0x00, 0x0b, 0xb4, 0x30, 0x00, 0xbe, 0xef, 0xd6, 0x01, 0x10, 0x3c, 0xe2, 0x00, 0x00, 0x3f, 0x60, 0x00, 0x04, 0xf5, 0x84, 0x04, 0xcd, 0x1b, 0xee, 0xec, 0x50, 0x02, 0x42, 0x00, 0x00, 0x00, 0x00, 0x24, 0x20, 0x00, 0x6c, 0xee, 0xc0, 0x05, 0xea, 0x30, 0x10, 0x0b, 0xb0, 0x00, 0x00, 0x0e, 0x74, 0x75, 0x00, 0x2f, 0xbd, 0xce, 0xb0, 0x4f, 0xa0, 0x03, 0xe7, 0x4f, 0x40, 0x00, 0xca, 0x0e, 0x70, 0x00, 0xc9, 0x0a, 0xd4, 0x07, 0xe5, 0x02, 0xbe, 0xee, 0x80, 0x00, 0x02, 0x41, 0x00, 0x5f, 0xff, 0xff, 0xfa, 0x14, 0x44, 0x44, 0xe8, 0x00, 0x00, 0x07, 0xe1, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00, 0x5e, 0x40, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x03, 0xe6, 0x00, 0x00, 0x0a, 0xd0, 0x00, 0x00, 0x1e, 0x80, 0x00, 0x00, 0x8e, 0x20, 0x00, 0x00, 0x03, 0x40, 0x00, 0x03, 0xce, 0xee, 0x70, 0x0a, 0xd3, 0x09, 0xe1, 0x0b, 0xa0, 0x05, 0xf3, 0x07, 0xe6, 0x2c, 0xc0, 0x00, 0x9e, 0xeb, 0x20, 0x05, 0xda, 0xae, 0x80, 0x0d, 0xa0, 0x06, 0xe6, 0x1f, 0x60, 0x00, 0xd9, 0x0d, 0xb1, 0x07, 0xe5, 0x05, 0xde, 0xee, 0x80, 0x00, 0x03, 0x41, 0x00, 0x00, 0x03, 0x40, 0x00, 0x04, 0xce, 0xed, 0x60, 0x0c, 0xb2, 0x2a, 0xe2, 0x3f, 0x50, 0x01, 0xd7, 0x4f, 0x30, 0x00, 0xca, 0x0e, 0x80, 0x06, 0xea, 0x07, 0xec, 0xcd, 0xda, 0x00, 0x37, 0x61, 0xe8, 0x00, 0x00, 0x07, 0xe3, 0x01, 0x00, 0x7e, 0xa0, 0x05, 0xee, 0xea, 0x00, 0x00, 0x44, 0x10, 0x00, 0x6a, 0x0b, 0xe1, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x0b, 0xe1, 0x02, 0x00, 0x04, 0xa4, 0x07, 0xf8, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xd5, 0x0a, 0xe1, 0x0c, 0xb0, 0x0e, 0x50, 0x00, 0x00, 0x05, 0x30, 0x00, 0x3b, 0xd3, 0x02, 0x9e, 0xa2, 0x07, 0xdb, 0x30, 0x00, 0xae, 0x92, 0x00, 0x00, 0x4b, 0xea, 0x30, 0x00, 0x04, 0xbe, 0x40, 0x00, 0x00, 0x42, 0x1d, 0xdd, 0xdd, 0xd8, 0x07, 0x77, 0x77, 0x74, 0x05, 0x55, 0x55, 0x53, 0x1e, 0xee, 0xee, 0xe9, 0x61, 0x00, 0x00, 0x0b, 0xd7, 0x00, 0x00, 0x07, 0xdc, 0x50, 0x00, 0x00, 0x8d, 0xb2, 0x00, 0x07, 0xdd, 0x30, 0x7d, 0xd7, 0x00, 0xbc, 0x70, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x09, 0xef, 0xed, 0x70, 0x67, 0x21, 0x9e, 0x20, 0x00, 0x03, 0xf4, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x70, 0x00, 0x8e, 0x50, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x42, 0x00, 0x00, 0x0b, 0x80, 0x00, 0x01, 0xeb, 0x00, 0x00, 0x02, 0x10, 0x00, 0x01, 0x9d, 0xed, 0x70, 0x00, 0xac, 0x40, 0x5d, 0x60, 0x5d, 0x23, 0x65, 0x7c, 0x0a, 0xa5, 0xeb, 0xe6, 0xe2, 0xc7, 0xc9, 0x0e, 0x5d, 0x5d, 0x6d, 0x60, 0xe4, 0xd5, 0xc6, 0xd6, 0x4f, 0x3d, 0x2b, 0x8a, 0xcb, 0xcb, 0xc0, 0x8c, 0x18, 0x72, 0x94, 0x01, 0xd9, 0x00, 0x03, 0x00, 0x04, 0xcd, 0xcd, 0xd0, 0x00, 0x00, 0x46, 0x40, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0xbe, 0x20, 0x00, 0x00, 0x1e, 0xd8, 0x00, 0x00, 0x07, 0xda, 0xc0, 0x00, 0x00, 0xbb, 0x5e, 0x20, 0x00, 0x1e, 0x70, 0xd8, 0x00, 0x07, 0xf6, 0x5c, 0xb0, 0x00, 0xbf, 0xee, 0xfe, 0x20, 0x1e, 0x80, 0x01, 0xe7, 0x06, 0xe2, 0x00, 0x0b, 0xb0, 0xac, 0x00, 0x00, 0x8e, 0x10, 0xcf, 0xfe, 0xd8, 0x0c, 0xa4, 0x5a, 0xe4, 0xca, 0x00, 0x0e, 0x7c, 0xa0, 0x05, 0xe4, 0xce, 0xcd, 0xd7, 0x0c, 0xc8, 0x8b, 0xd4, 0xca, 0x00, 0x0d, 0xac, 0xa0, 0x00, 0xcb, 0xca, 0x44, 0x8e, 0x7c, 0xff, 0xed, 0x90, 0x00, 0x00, 0x34, 0x10, 0x00, 0x6d, 0xff, 0xe9, 0x05, 0xeb, 0x32, 0x65, 0x0b, 0xc0, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x2f, 0x70, 0x00, 0x00, 0x2f, 0x60, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x00, 0x06, 0xea, 0x42, 0x64, 0x00, 0x7d, 0xff, 0xe6, 0x00, 0x00, 0x34, 0x10, 0x1f, 0xfe, 0xda, 0x10, 0x1f, 0x74, 0x8d, 0xc0, 0x1f, 0x60, 0x04, 0xe7, 0x1f, 0x60, 0x00, 0xcb, 0x1f, 0x60, 0x00, 0xac, 0x1f, 0x60, 0x00, 0xbc, 0x1f, 0x60, 0x00, 0xcb, 0x1f, 0x60, 0x05, 0xe7, 0x1f, 0x75, 0x8e, 0xc0, 0x1f, 0xfe, 0xd9, 0x10, 0xcf, 0xff, 0xff, 0x6c, 0xb4, 0x44, 0x41, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0xce, 0xdd, 0xdc, 0x0c, 0xc8, 0x88, 0x70, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0xcb, 0x44, 0x44, 0x1c, 0xff, 0xff, 0xf6, 0xcf, 0xff, 0xff, 0x6c, 0xb4, 0x44, 0x41, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0xcc, 0x88, 0x87, 0x0c, 0xec, 0xcc, 0xc0, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x9e, 0xff, 0xd4, 0x09, 0xe8, 0x33, 0x70, 0x1e, 0x90, 0x00, 0x00, 0x6f, 0x40, 0x00, 0x00, 0x8e, 0x00, 0x57, 0x74, 0x8e, 0x00, 0xad, 0xe9, 0x7f, 0x30, 0x00, 0xd9, 0x2e, 0x80, 0x00, 0xd9, 0x0a, 0xe7, 0x22, 0xd9, 0x01, 0xae, 0xff, 0xe7, 0x00, 0x01, 0x43, 0x00, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0xdd, 0xdd, 0xe9, 0x1f, 0xa8, 0x88, 0xe9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x9e, 0xff, 0xed, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x9d, 0x00, 0x9e, 0xff, 0xed, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xd9, 0x64, 0x39, 0xf6, 0xae, 0xfe, 0xa0, 0x02, 0x42, 0x00, 0x1f, 0x60, 0x07, 0xe6, 0x1f, 0x60, 0x3e, 0x90, 0x1f, 0x60, 0xcc, 0x00, 0x1f, 0x69, 0xe3, 0x00, 0x1f, 0x9e, 0x90, 0x00, 0x1f, 0xec, 0xd1, 0x00, 0x1f, 0x92, 0xda, 0x00, 0x1f, 0x60, 0x7e, 0x50, 0x1f, 0x60, 0x0c, 0xc0, 0x1f, 0x60, 0x04, 0xe8, 0x8d, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0x8e, 0x55, 0x55, 0x28, 0xff, 0xff, 0xf6, 0x7f, 0xb0, 0x07, 0xfc, 0x7e, 0xe1, 0x0a, 0xec, 0x7d, 0xd6, 0x0d, 0xcc, 0x7d, 0xba, 0x4e, 0xac, 0x7e, 0x7d, 0x8c, 0xac, 0x7e, 0x2e, 0xc8, 0xac, 0x7e, 0x0c, 0xe3, 0xac, 0x7e, 0x06, 0x90, 0xac, 0x7e, 0x00, 0x00, 0xac, 0x7e, 0x00, 0x00, 0xac, 0x1f, 0xd0, 0x00, 0xd9, 0x1f, 0xd7, 0x00, 0xd9, 0x1f, 0xac, 0x00, 0xd9, 0x1f, 0x6e, 0x50, 0xd9, 0x1f, 0x6a, 0xb0, 0xd9, 0x1f, 0x64, 0xe3, 0xd9, 0x1f, 0x60, 0xba, 0xd9, 0x1f, 0x60, 0x6e, 0xc9, 0x1f, 0x60, 0x0c, 0xe9, 0x1f, 0x60, 0x08, 0xf9, 0x00, 0x03, 0x41, 0x00, 0x02, 0xcf, 0xee, 0x70, 0x0b, 0xd4, 0x19, 0xe2, 0x2e, 0x70, 0x00, 0xe8, 0x6e, 0x20, 0x00, 0xbb, 0x8e, 0x00, 0x00, 0xac, 0x8e, 0x00, 0x00, 0xac, 0x6e, 0x20, 0x00, 0xbb, 0x3e, 0x70, 0x00, 0xd9, 0x0b, 0xd5, 0x2a, 0xe3, 0x02, 0xce, 0xfd, 0x60, 0x00, 0x03, 0x40, 0x00, 0xcf, 0xfe, 0xd8, 0x0c, 0xb4, 0x49, 0xe7, 0xcb, 0x00, 0x0c, 0xac, 0xb0, 0x00, 0xca, 0xcb, 0x01, 0x7e, 0x6c, 0xee, 0xee, 0x90, 0xcb, 0x54, 0x10, 0x0c, 0xb0, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0x00, 0x03, 0x41, 0x00, 0x02, 0xcf, 0xee, 0x70, 0x0b, 0xd4, 0x19, 0xe2, 0x2e, 0x70, 0x00, 0xe8, 0x6e, 0x20, 0x00, 0xbb, 0x8e, 0x00, 0x00, 0xac, 0x8e, 0x00, 0x00, 0xac, 0x6e, 0x20, 0x00, 0xbb, 0x3e, 0x70, 0x00, 0xd9, 0x0b, 0xd5, 0x2b, 0xe3, 0x02, 0xce, 0xff, 0x70, 0x00, 0x03, 0x4d, 0xa0, 0x00, 0x00, 0x08, 0xe3, 0x00, 0x00, 0x01, 0xa6, 0xcf, 0xee, 0xc5, 0x0c, 0xb4, 0x6c, 0xd1, 0xcb, 0x00, 0x6f, 0x5c, 0xb0, 0x06, 0xf4, 0xcc, 0x57, 0xdb, 0x0c, 0xee, 0xeb, 0x10, 0xcb, 0x0a, 0xd1, 0x0c, 0xb0, 0x2d, 0x90, 0xcb, 0x00, 0x7e, 0x4c, 0xb0, 0x00, 0xcc, 0x00, 0x24, 0x20, 0x01, 0xae, 0xff, 0xd3, 0x8e, 0x71, 0x47, 0x0a, 0xc0, 0x00, 0x00, 0x8e, 0x60, 0x00, 0x01, 0xbe, 0xc5, 0x00, 0x00, 0x5c, 0xeb, 0x00, 0x00, 0x06, 0xf7, 0x00, 0x00, 0x0e, 0x88, 0x41, 0x29, 0xe5, 0xbe, 0xee, 0xe8, 0x00, 0x14, 0x30, 0x00, 0x8f, 0xff, 0xff, 0xfc, 0x24, 0x4a, 0xd4, 0x44, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1f, 0x60, 0x00, 0xd9, 0x1e, 0x70, 0x00, 0xd9, 0x0e, 0x80, 0x01, 0xe7, 0x0b, 0xd4, 0x2a, 0xe3, 0x03, 0xcf, 0xfe, 0x70, 0x00, 0x03, 0x41, 0x00, 0xad, 0x00, 0x00, 0x9e, 0x05, 0xf4, 0x00, 0x0c, 0xb0, 0x0d, 0x90, 0x02, 0xe7, 0x00, 0xac, 0x00, 0x7e, 0x10, 0x06, 0xe2, 0x0b, 0xb0, 0x00, 0x0e, 0x70, 0xd7, 0x00, 0x00, 0xab, 0x5e, 0x20, 0x00, 0x06, 0xe9, 0xc0, 0x00, 0x00, 0x1e, 0xd8, 0x00, 0x00, 0x00, 0xbe, 0x30, 0x00, 0xba, 0x00, 0x00, 0x5e, 0x1a, 0xb0, 0x00, 0x06, 0xe0, 0x8c, 0x06, 0x90, 0x8d, 0x07, 0xd0, 0xbe, 0x39, 0xc0, 0x5e, 0x0d, 0xc7, 0xab, 0x02, 0xf4, 0xd9, 0xab, 0xa0, 0x0e, 0x9b, 0x5c, 0xb8, 0x00, 0xdc, 0x80, 0xdc, 0x70, 0x0c, 0xe5, 0x0c, 0xe6, 0x00, 0xbe, 0x00, 0x9f, 0x40, 0x3e, 0x80, 0x02, 0xd9, 0x08, 0xd2, 0x09, 0xd1, 0x00, 0xd9, 0x4e, 0x60, 0x00, 0x6e, 0xcb, 0x00, 0x00, 0x0b, 0xe3, 0x00, 0x00, 0x1d, 0xe6, 0x00, 0x00, 0x9d, 0x9d, 0x00, 0x03, 0xe7, 0x1d, 0x80, 0x0b, 0xc0, 0x07, 0xe3, 0x6e, 0x50, 0x00, 0xcb, 0x7e, 0x40, 0x00, 0xcb, 0x0c, 0xa0, 0x05, 0xe5, 0x06, 0xe3, 0x0b, 0xb0, 0x00, 0xca, 0x3e, 0x50, 0x00, 0x6e, 0xab, 0x00, 0x00, 0x0c, 0xe4, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x00, 0x09, 0xd0, 0x00, 0x8f, 0xff, 0xff, 0x32, 0x44, 0x4a, 0xd0, 0x00, 0x03, 0xe6, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x5e, 0x50, 0x00, 0x0c, 0xa0, 0x00, 0x07, 0xe3, 0x00, 0x01, 0xd9, 0x00, 0x00, 0x8e, 0x54, 0x44, 0x1c, 0xff, 0xff, 0xf3, 0xbf, 0xfa, 0xba, 0x11, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xba, 0x00, 0xbe, 0xd9, 0x46, 0x64, 0x4e, 0x40, 0x00, 0x0c, 0x90, 0x00, 0x08, 0xd0, 0x00, 0x02, 0xe6, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x6e, 0x20, 0x00, 0x0d, 0x80, 0x00, 0x09, 0xc0, 0x00, 0x03, 0xe5, 0x00, 0x00, 0xca, 0x4f, 0xff, 0x20, 0x15, 0xf2, 0x00, 0x5f, 0x20, 0x05, 0xf2, 0x00, 0x5f, 0x20, 0x05, 0xf2, 0x00, 0x5f, 0x20, 0x05, 0xf2, 0x00, 0x5f, 0x20, 0x05, 0xf2, 0x00, 0x5f, 0x23, 0xdd, 0xf2, 0x16, 0x66, 0x10, 0x00, 0x01, 0x10, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0x3d, 0xd6, 0x00, 0x00, 0xaa, 0x7c, 0x00, 0x02, 0xe3, 0x0d, 0x60, 0x09, 0xb0, 0x07, 0xd0, 0x2e, 0x50, 0x00, 0xd7, 0x36, 0x00, 0x00, 0x45, 0xee, 0xee, 0xee, 0xee, 0x85, 0x55, 0x55, 0x55, 0x53, 0x4c, 0x60, 0x09, 0xd1, 0x00, 0x85, 0x02, 0x8a, 0xb9, 0x20, 0x07, 0xc9, 0x9d, 0xc0, 0x00, 0x00, 0x04, 0xf3, 0x00, 0x59, 0xaa, 0xf5, 0x0a, 0xea, 0x88, 0xf5, 0x0e, 0x70, 0x04, 0xf5, 0x0e, 0x80, 0x3c, 0xf5, 0x08, 0xee, 0xe8, 0xe5, 0x00, 0x14, 0x10, 0x00, 0xa6, 0x00, 0x00, 0x0d, 0x80, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x0d, 0x89, 0xb9, 0x30, 0xdd, 0xb9, 0xdd, 0x1d, 0xc0, 0x02, 0xe8, 0xd9, 0x00, 0x0c, 0xad, 0x80, 0x00, 0xcb, 0xda, 0x00, 0x0d, 0x9d, 0xe4, 0x07, 0xe4, 0xd9, 0xee, 0xe8, 0x00, 0x01, 0x41, 0x00, 0x02, 0x9b, 0xa8, 0x03, 0xdd, 0xaa, 0xc0, 0xad, 0x10, 0x00, 0x0c, 0xa0, 0x00, 0x00, 0xda, 0x00, 0x00, 0x0c, 0xb0, 0x00, 0x00, 0x8e, 0x70, 0x16, 0x00, 0xae, 0xee, 0xd0, 0x00, 0x14, 0x30, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x7b, 0xa5, 0xe7, 0x0a, 0xea, 0x9d, 0xe7, 0x2e, 0x90, 0x07, 0xf7, 0x5f, 0x50, 0x03, 0xf7, 0x5f, 0x30, 0x00, 0xe7, 0x3f, 0x60, 0x04, 0xf7, 0x0c, 0xc2, 0x1b, 0xf7, 0x04, 0xde, 0xea, 0xd7, 0x00, 0x03, 0x20, 0x00, 0x00, 0x5a, 0xb9, 0x20, 0x06, 0xeb, 0x9c, 0xd1, 0x0d, 0xa0, 0x02, 0xe8, 0x3f, 0xba, 0xaa, 0xda, 0x4f, 0xaa, 0xaa, 0xa7, 0x2e, 0x70, 0x00, 0x00, 0x0b, 0xd5, 0x01, 0x64, 0x02, 0xbe, 0xee, 0xd5, 0x00, 0x01, 0x43, 0x00, 0x00, 0x00, 0x8b, 0xca, 0x00, 0x08, 0xe9, 0x88, 0x00, 0x0b, 0xc0, 0x00, 0x18, 0x9d, 0xda, 0xa6, 0x2a, 0xad, 0xda, 0xa7, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x0b, 0xb0, 0x00, 0x00, 0x7b, 0xa5, 0x85, 0x09, 0xea, 0x9d, 0xe7, 0x1e, 0x90, 0x05, 0xf7, 0x4f, 0x40, 0x00, 0xe7, 0x6f, 0x30, 0x00, 0xd7, 0x3f, 0x60, 0x01, 0xe7, 0x0c, 0xc2, 0x0a, 0xf7, 0x04, 0xde, 0xec, 0xe7, 0x00, 0x04, 0x20, 0xe6, 0x03, 0x00, 0x06, 0xe3, 0x0d, 0xcb, 0xce, 0xa0, 0x02, 0x79, 0x85, 0x00, 0xa6, 0x00, 0x00, 0x0d, 0x80, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x0d, 0x87, 0xba, 0x40, 0xdc, 0xb9, 0xce, 0x2d, 0xc0, 0x03, 0xe7, 0xd9, 0x00, 0x0e, 0x8d, 0x80, 0x00, 0xe8, 0xd8, 0x00, 0x0e, 0x8d, 0x80, 0x00, 0xe8, 0xd8, 0x00, 0x0e, 0x80, 0x00, 0x5a, 0x20, 0x00, 0x09, 0xe4, 0x00, 0x00, 0x02, 0x00, 0x08, 0xaa, 0xa1, 0x00, 0x69, 0xbf, 0x20, 0x00, 0x06, 0xf2, 0x00, 0x00, 0x6f, 0x20, 0x00, 0x06, 0xf2, 0x00, 0x00, 0x6f, 0x20, 0x00, 0x06, 0xf3, 0x00, 0xce, 0xff, 0xee, 0xa0, 0x00, 0x00, 0xa7, 0x00, 0x01, 0xeb, 0x00, 0x00, 0x20, 0x03, 0xaa, 0xa7, 0x02, 0x9a, 0xda, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x00, 0xca, 0x00, 0x02, 0xe9, 0x4c, 0xbd, 0xd3, 0x27, 0x97, 0x20, 0x89, 0x00, 0x00, 0x0a, 0xc0, 0x00, 0x00, 0xac, 0x00, 0x00, 0x0a, 0xc0, 0x01, 0x97, 0xac, 0x00, 0xbd, 0x2a, 0xc0, 0xad, 0x30, 0xac, 0x9e, 0x40, 0x0a, 0xdd, 0xe8, 0x00, 0xad, 0x37, 0xe5, 0x0a, 0xc0, 0x0a, 0xd2, 0xac, 0x00, 0x1d, 0xb0, 0xab, 0xbb, 0x30, 0x06, 0x79, 0xf4, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x05, 0xf4, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x05, 0xf4, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x05, 0xf4, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x05, 0xf4, 0x00, 0xce, 0xff, 0xee, 0xa0, 0x57, 0x9b, 0x39, 0xa3, 0x7e, 0xbd, 0xdb, 0xda, 0x7e, 0x19, 0xe1, 0x9c, 0x7d, 0x08, 0xd0, 0x9c, 0x7d, 0x08, 0xd0, 0x9c, 0x7d, 0x08, 0xd0, 0x9c, 0x7d, 0x08, 0xd0, 0x9c, 0x7d, 0x08, 0xd0, 0x9c, 0x93, 0x8b, 0xa4, 0x0d, 0xdb, 0x9c, 0xe2, 0xdc, 0x00, 0x2e, 0x7d, 0x90, 0x00, 0xe8, 0xd8, 0x00, 0x0e, 0x8d, 0x80, 0x00, 0xe8, 0xd8, 0x00, 0x0e, 0x8d, 0x80, 0x00, 0xe8, 0x00, 0x6a, 0xb8, 0x10, 0x08, 0xea, 0x9d, 0xc1, 0x1e, 0x80, 0x03, 0xe7, 0x5f, 0x40, 0x00, 0xca, 0x6f, 0x30, 0x00, 0xcb, 0x3f, 0x60, 0x00, 0xd9, 0x0b, 0xc2, 0x08, 0xe4, 0x03, 0xce, 0xed, 0x70, 0x00, 0x02, 0x30, 0x00, 0x94, 0x9b, 0x93, 0x0d, 0xdb, 0x9c, 0xd1, 0xdb, 0x00, 0x2e, 0x8d, 0x90, 0x00, 0xca, 0xd8, 0x00, 0x0c, 0xbd, 0xa0, 0x00, 0xda, 0xdd, 0x40, 0x7e, 0x5d, 0xad, 0xee, 0x90, 0xd8, 0x04, 0x20, 0x0d, 0x80, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x00, 0x7a, 0xa4, 0x85, 0x08, 0xea, 0x9d, 0xe7, 0x1e, 0x80, 0x07, 0xf7, 0x4f, 0x40, 0x02, 0xf7, 0x6f, 0x30, 0x00, 0xe7, 0x3f, 0x60, 0x04, 0xf7, 0x0c, 0xc2, 0x1b, 0xf7, 0x04, 0xde, 0xea, 0xe7, 0x00, 0x03, 0x30, 0xe7, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x84, 0x09, 0xaa, 0x38, 0xb9, 0x00, 0x8a, 0xeb, 0xda, 0xa0, 0x00, 0x0d, 0xd2, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0x0d, 0x90, 0x00, 0x04, 0xee, 0xff, 0xea, 0x00, 0x06, 0xab, 0xa6, 0x5e, 0xa9, 0xa9, 0x8e, 0x10, 0x00, 0x3d, 0xd7, 0x10, 0x02, 0x9d, 0xd6, 0x00, 0x01, 0xbd, 0x64, 0x00, 0xad, 0x8e, 0xee, 0xe7, 0x01, 0x44, 0x00, 0x00, 0x09, 0x20, 0x00, 0x00, 0x2f, 0x40, 0x00, 0x39, 0xbf, 0xaa, 0xa1, 0x4a, 0xbf, 0xba, 0xa1, 0x00, 0x5f, 0x40, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x00, 0x5f, 0x40, 0x00, 0x00, 0x3e, 0x90, 0x01, 0x00, 0x09, 0xee, 0xe6, 0x00, 0x00, 0x14, 0x30, 0x95, 0x00, 0x0a, 0x5e, 0x70, 0x00, 0xe7, 0xe7, 0x00, 0x0e, 0x7e, 0x70, 0x00, 0xe7, 0xe7, 0x00, 0x0e, 0x7e, 0x80, 0x04, 0xf7, 0xdb, 0x11, 0xbf, 0x76, 0xee, 0xea, 0xd7, 0x01, 0x42, 0x00, 0x00, 0x5a, 0x10, 0x00, 0x88, 0x2e, 0x70, 0x01, 0xe8, 0x0b, 0xb0, 0x06, 0xe2, 0x07, 0xe2, 0x0b, 0xb0, 0x01, 0xe8, 0x1e, 0x70, 0x00, 0xac, 0x7d, 0x00, 0x00, 0x5e, 0xca, 0x00, 0x00, 0x0d, 0xf5, 0x00, 0x86, 0x00, 0x00, 0x0a, 0x3b, 0xa0, 0x23, 0x04, 0xe2, 0x9c, 0x0c, 0xe3, 0x7d, 0x07, 0xd1, 0xec, 0x89, 0xc0, 0x5e, 0x7d, 0x9b, 0xba, 0x01, 0xeb, 0xa5, 0xdc, 0x80, 0x0d, 0xd7, 0x0e, 0xd6, 0x00, 0xbe, 0x20, 0xce, 0x20, 0x2a, 0x50, 0x01, 0x96, 0x0a, 0xd2, 0x0a, 0xd2, 0x01, 0xcb, 0x6e, 0x50, 0x00, 0x4e, 0xe9, 0x00, 0x00, 0x1d, 0xe6, 0x00, 0x00, 0xad, 0xad, 0x20, 0x07, 0xe5, 0x0c, 0xb0, 0x4e, 0x90, 0x04, 0xe8, 0x49, 0x00, 0x00, 0x78, 0x2e, 0x70, 0x00, 0xd8, 0x0a, 0xc0, 0x06, 0xe2, 0x04, 0xe4, 0x0a, 0xb0, 0x00, 0xca, 0x0d, 0x70, 0x00, 0x7d, 0x6e, 0x10, 0x00, 0x1d, 0xca, 0x00, 0x00, 0x09, 0xf5, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0x1d, 0x80, 0x00, 0x3b, 0xdc, 0x10, 0x00, 0x29, 0x82, 0x00, 0x00, 0x7a, 0xaa, 0xaa, 0x16, 0x99, 0x9c, 0xe1, 0x00, 0x05, 0xe6, 0x00, 0x02, 0xd9, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x9d, 0x20, 0x00, 0x6e, 0x63, 0x33, 0x1c, 0xff, 0xff, 0xf5, 0x00, 0x09, 0xd9, 0x00, 0x5f, 0x71, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8d, 0x00, 0x1a, 0xd9, 0x00, 0x2c, 0xd7, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x6e, 0x40, 0x00, 0x1b, 0xe8, 0x00, 0x00, 0x33, 0x59, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x47, 0x2e, 0xc3, 0x00, 0x04, 0xcb, 0x00, 0x00, 0xac, 0x00, 0x00, 0xac, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x4d, 0xb5, 0x00, 0x2b, 0xd7, 0x00, 0x9d, 0x10, 0x00, 0xac, 0x00, 0x00, 0xac, 0x00, 0x01, 0xcb, 0x00, 0x2e, 0xd5, 0x00, 0x14, 0x00, 0x00, 0x28, 0x60, 0x07, 0x5b, 0xac, 0xa1, 0xc4, 0xd0, 0x1a, 0xda, 0x00, ]; /// Glyph metadata for binary search pub const NOTO_SANS_MONO_14_REGULAR_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 0, }, GlyphInfo { character: '!', width: 3, height: 11, x_offset: 3, y_offset: 1, x_advance: 8, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 4, x_offset: 2, y_offset: 1, x_advance: 8, data_offset: 17, }, GlyphInfo { character: '#', width: 9, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 27, }, GlyphInfo { character: '$', width: 7, height: 12, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 72, }, GlyphInfo { character: '%', width: 9, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 114, }, GlyphInfo { character: '&', width: 9, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 168, }, GlyphInfo { character: '\'', width: 2, height: 4, x_offset: 3, y_offset: 1, x_advance: 8, data_offset: 222, }, GlyphInfo { character: '(', width: 5, height: 13, x_offset: 2, y_offset: 1, x_advance: 8, data_offset: 226, }, GlyphInfo { character: ')', width: 4, height: 13, x_offset: 2, y_offset: 1, x_advance: 8, data_offset: 259, }, GlyphInfo { character: '*', width: 7, height: 7, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 285, }, GlyphInfo { character: '+', width: 7, height: 8, x_offset: 1, y_offset: 2, x_advance: 8, data_offset: 310, }, GlyphInfo { character: ',', width: 4, height: 4, x_offset: 2, y_offset: 9, x_advance: 8, data_offset: 338, }, GlyphInfo { character: '-', width: 5, height: 2, x_offset: 2, y_offset: 6, x_advance: 8, data_offset: 346, }, GlyphInfo { character: '.', width: 3, height: 3, x_offset: 3, y_offset: 9, x_advance: 8, data_offset: 351, }, GlyphInfo { character: '/', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 356, }, GlyphInfo { character: '0', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 386, }, GlyphInfo { character: '1', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 434, }, GlyphInfo { character: '2', width: 8, height: 11, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 469, }, GlyphInfo { character: '3', width: 7, height: 12, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 513, }, GlyphInfo { character: '4', width: 8, height: 11, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 555, }, GlyphInfo { character: '5', width: 7, height: 11, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 599, }, GlyphInfo { character: '6', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 638, }, GlyphInfo { character: '7', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 686, }, GlyphInfo { character: '8', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 726, }, GlyphInfo { character: '9', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 774, }, GlyphInfo { character: ':', width: 3, height: 9, x_offset: 3, y_offset: 3, x_advance: 8, data_offset: 822, }, GlyphInfo { character: ';', width: 4, height: 10, x_offset: 2, y_offset: 3, x_advance: 8, data_offset: 836, }, GlyphInfo { character: '<', width: 7, height: 8, x_offset: 1, y_offset: 2, x_advance: 8, data_offset: 856, }, GlyphInfo { character: '=', width: 8, height: 4, x_offset: 0, y_offset: 4, x_advance: 8, data_offset: 884, }, GlyphInfo { character: '>', width: 7, height: 8, x_offset: 1, y_offset: 2, x_advance: 8, data_offset: 900, }, GlyphInfo { character: '?', width: 7, height: 12, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 928, }, GlyphInfo { character: '@', width: 9, height: 12, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 970, }, GlyphInfo { character: 'A', width: 9, height: 11, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1024, }, GlyphInfo { character: 'B', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1074, }, GlyphInfo { character: 'C', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1109, }, GlyphInfo { character: 'D', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1157, }, GlyphInfo { character: 'E', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1197, }, GlyphInfo { character: 'F', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1232, }, GlyphInfo { character: 'G', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1267, }, GlyphInfo { character: 'H', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1315, }, GlyphInfo { character: 'I', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1355, }, GlyphInfo { character: 'J', width: 6, height: 11, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1385, }, GlyphInfo { character: 'K', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1418, }, GlyphInfo { character: 'L', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1458, }, GlyphInfo { character: 'M', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1493, }, GlyphInfo { character: 'N', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1533, }, GlyphInfo { character: 'O', width: 8, height: 12, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1573, }, GlyphInfo { character: 'P', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1621, }, GlyphInfo { character: 'Q', width: 8, height: 14, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 1656, }, GlyphInfo { character: 'R', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 1712, }, GlyphInfo { character: 'S', width: 7, height: 12, x_offset: 1, y_offset: 0, x_advance: 8, data_offset: 1747, }, GlyphInfo { character: 'T', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1789, }, GlyphInfo { character: 'U', width: 8, height: 11, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1829, }, GlyphInfo { character: 'V', width: 9, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1873, }, GlyphInfo { character: 'W', width: 9, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1918, }, GlyphInfo { character: 'X', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 1963, }, GlyphInfo { character: 'Y', width: 8, height: 10, x_offset: 0, y_offset: 1, x_advance: 8, data_offset: 2003, }, GlyphInfo { character: 'Z', width: 7, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 2043, }, GlyphInfo { character: '[', width: 4, height: 13, x_offset: 3, y_offset: 1, x_advance: 8, data_offset: 2078, }, GlyphInfo { character: '\\', width: 6, height: 10, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 2104, }, GlyphInfo { character: ']', width: 5, height: 13, x_offset: 1, y_offset: 1, x_advance: 8, data_offset: 2134, }, GlyphInfo { character: '^', width: 8, height: 8, x_offset: 0, y_offset: 0, x_advance: 8, data_offset: 2167, }, GlyphInfo { character: '_', width: 9, height: 2, x_offset: 0, y_offset: 12, x_advance: 8, data_offset: 2199, }, GlyphInfo { character: '`', width: 4, height: 3, x_offset: 2, y_offset: 0, x_advance: 8, data_offset: 2208, }, GlyphInfo { character: 'a', width: 8, height: 9, x_offset: 0, y_offset: 3, x_advance: 8, data_offset: 2214, }, GlyphInfo { character: 'b', width: 7,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_17_regular.rs
frostsnap_fonts/src/noto_sans_17_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 17px //! Weight: 400 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_17_REGULAR_DATA: &[u8] = &[ 0x35, 0x2b, 0xf5, 0xaf, 0x4a, 0xf3, 0x9f, 0x19, 0xe0, 0x8e, 0x07, 0xd0, 0x7d, 0x04, 0x90, 0x01, 0x0b, 0xe5, 0xcf, 0x62, 0x50, 0x44, 0x04, 0x4d, 0xc0, 0xcd, 0xcb, 0x0b, 0xcc, 0xa0, 0xbb, 0xb9, 0x0a, 0xa5, 0x40, 0x44, 0x00, 0x00, 0x43, 0x01, 0x50, 0x00, 0x00, 0x0e, 0x70, 0x6e, 0x00, 0x00, 0x04, 0xf4, 0x09, 0xc0, 0x00, 0x00, 0x7e, 0x00, 0xba, 0x00, 0x0a, 0xac, 0xea, 0xae, 0xca, 0x70, 0xab, 0xed, 0xbb, 0xfb, 0xb8, 0x00, 0x0d, 0x80, 0x6e, 0x10, 0x00, 0x03, 0xe5, 0x09, 0xd0, 0x00, 0x8c, 0xcf, 0xcc, 0xde, 0xcb, 0x07, 0x9c, 0xd9, 0x9e, 0xb9, 0x90, 0x00, 0xbb, 0x01, 0xe6, 0x00, 0x00, 0x0d, 0x80, 0x6e, 0x20, 0x00, 0x01, 0xe6, 0x08, 0xd0, 0x00, 0x00, 0x00, 0x0b, 0x80, 0x00, 0x02, 0x7d, 0xb7, 0x30, 0x6e, 0xfe, 0xef, 0xe6, 0xdd, 0x4c, 0x82, 0x71, 0xeb, 0x0c, 0x80, 0x00, 0xce, 0x8c, 0x80, 0x00, 0x3c, 0xff, 0xc8, 0x10, 0x00, 0x5d, 0xef, 0xd4, 0x00, 0x0c, 0x86, 0xeb, 0x00, 0x0c, 0x80, 0xcc, 0xb8, 0x6c, 0xaa, 0xe8, 0xce, 0xff, 0xfd, 0x80, 0x01, 0x4c, 0x90, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x46, 0x20, 0x00, 0x02, 0x50, 0x00, 0x08, 0xed, 0xd4, 0x00, 0x0b, 0xc0, 0x00, 0x0d, 0x90, 0xca, 0x00, 0x5e, 0x50, 0x00, 0x3f, 0x50, 0x9c, 0x00, 0xcb, 0x00, 0x00, 0x5f, 0x30, 0x8d, 0x06, 0xe4, 0x00, 0x00, 0x3f, 0x50, 0x9c, 0x0d, 0xa4, 0x87, 0x00, 0x0d, 0x90, 0xca, 0x8e, 0x5e, 0xce, 0xa0, 0x08, 0xed, 0xe5, 0xd9, 0xac, 0x06, 0xe2, 0x00, 0x57, 0x39, 0xd1, 0xba, 0x01, 0xf6, 0x00, 0x00, 0x3e, 0x70, 0xca, 0x00, 0xe7, 0x00, 0x00, 0xac, 0x00, 0xbb, 0x02, 0xf5, 0x00, 0x05, 0xe6, 0x00, 0x8d, 0x28, 0xe1, 0x00, 0x0c, 0xb0, 0x00, 0x2c, 0xee, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x02, 0x77, 0x40, 0x00, 0x00, 0x00, 0x07, 0xee, 0xee, 0x90, 0x00, 0x00, 0x00, 0xdd, 0x31, 0xce, 0x10, 0x00, 0x00, 0x0e, 0xa0, 0x09, 0xf3, 0x00, 0x00, 0x00, 0xcd, 0x22, 0xdd, 0x00, 0x00, 0x00, 0x05, 0xec, 0xdd, 0x40, 0x00, 0x00, 0x00, 0x4d, 0xfe, 0x30, 0x00, 0x22, 0x00, 0x6e, 0xd9, 0xec, 0x20, 0x2e, 0x90, 0x0d, 0xd3, 0x07, 0xec, 0x28, 0xf4, 0x02, 0xfa, 0x00, 0x07, 0xec, 0xeb, 0x00, 0x1e, 0xb0, 0x00, 0x08, 0xfe, 0x40, 0x00, 0xbe, 0xa6, 0x6a, 0xed, 0xed, 0x30, 0x03, 0xbe, 0xff, 0xea, 0x26, 0xed, 0x30, 0x00, 0x25, 0x30, 0x00, 0x00, 0x00, 0x44, 0xdc, 0xcb, 0xca, 0xb9, 0x54, 0x00, 0x04, 0x30, 0x07, 0xe6, 0x02, 0xdb, 0x00, 0x8f, 0x50, 0x0c, 0xd0, 0x02, 0xea, 0x00, 0x5f, 0x80, 0x06, 0xf6, 0x00, 0x7f, 0x60, 0x06, 0xf6, 0x00, 0x4f, 0x80, 0x01, 0xeb, 0x00, 0x0b, 0xe1, 0x00, 0x6f, 0x80, 0x00, 0xcd, 0x20, 0x03, 0xb7, 0x34, 0x00, 0x04, 0xe8, 0x00, 0x0a, 0xe3, 0x00, 0x3e, 0xa0, 0x00, 0xcd, 0x00, 0x09, 0xf4, 0x00, 0x6f, 0x70, 0x04, 0xf8, 0x00, 0x4f, 0x90, 0x05, 0xf8, 0x00, 0x7f, 0x60, 0x0a, 0xe2, 0x00, 0xdc, 0x00, 0x6f, 0x70, 0x0c, 0xc0, 0x05, 0xc4, 0x00, 0x00, 0x04, 0xe8, 0x00, 0x00, 0x00, 0x2f, 0x80, 0x00, 0x39, 0x40, 0xe6, 0x38, 0x66, 0xff, 0xde, 0xde, 0xfa, 0x02, 0x5b, 0xed, 0x53, 0x10, 0x05, 0xe8, 0xe9, 0x00, 0x02, 0xdd, 0x0a, 0xe6, 0x00, 0x07, 0x70, 0x3a, 0x20, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x3b, 0xbb, 0xed, 0xbb, 0xa4, 0xbb, 0xbe, 0xdb, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x03, 0x20, 0x00, 0x0a, 0xe5, 0x0c, 0xd0, 0x0e, 0xa0, 0x5e, 0x40, 0x25, 0x00, 0x36, 0x66, 0x57, 0xff, 0xfd, 0x24, 0x44, 0x30, 0x01, 0x0b, 0xe5, 0xcf, 0x62, 0x50, 0x00, 0x00, 0x25, 0x10, 0x00, 0x0a, 0xe1, 0x00, 0x01, 0xea, 0x00, 0x00, 0x7f, 0x50, 0x00, 0x0c, 0xd0, 0x00, 0x03, 0xe9, 0x00, 0x00, 0x9e, 0x30, 0x00, 0x0d, 0xc0, 0x00, 0x05, 0xf7, 0x00, 0x00, 0xae, 0x10, 0x00, 0x1e, 0xa0, 0x00, 0x07, 0xf5, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x04, 0x76, 0x20, 0x00, 0x0a, 0xee, 0xfd, 0x60, 0x07, 0xfa, 0x23, 0xce, 0x20, 0xcd, 0x00, 0x04, 0xe8, 0x1e, 0xa0, 0x00, 0x0d, 0xb4, 0xf8, 0x00, 0x00, 0xcd, 0x5f, 0x80, 0x00, 0x0b, 0xd4, 0xf8, 0x00, 0x00, 0xbd, 0x3f, 0x90, 0x00, 0x0c, 0xd0, 0xea, 0x00, 0x00, 0xdb, 0x0b, 0xd1, 0x00, 0x5f, 0x90, 0x5e, 0xb5, 0x6d, 0xe2, 0x00, 0x7e, 0xff, 0xd5, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x02, 0x50, 0x00, 0x5d, 0xf2, 0x08, 0xed, 0xf2, 0x6e, 0x99, 0xf2, 0x05, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x09, 0xf2, 0x00, 0x05, 0x76, 0x10, 0x00, 0x7d, 0xfe, 0xfe, 0x70, 0x0c, 0xb5, 0x04, 0xde, 0x30, 0x10, 0x00, 0x07, 0xf7, 0x00, 0x00, 0x00, 0x6f, 0x70, 0x00, 0x00, 0x0a, 0xe2, 0x00, 0x00, 0x05, 0xea, 0x00, 0x00, 0x04, 0xec, 0x10, 0x00, 0x04, 0xdc, 0x20, 0x00, 0x04, 0xdc, 0x20, 0x00, 0x03, 0xdc, 0x20, 0x00, 0x03, 0xde, 0x98, 0x88, 0x87, 0x5f, 0xff, 0xff, 0xff, 0xd0, 0x00, 0x16, 0x76, 0x20, 0x01, 0x9e, 0xfe, 0xfe, 0x80, 0x1c, 0x94, 0x04, 0xce, 0x40, 0x00, 0x00, 0x06, 0xf7, 0x00, 0x00, 0x00, 0x7f, 0x70, 0x00, 0x00, 0x6d, 0xc1, 0x00, 0x8e, 0xee, 0xa2, 0x00, 0x05, 0x89, 0xbe, 0xc3, 0x00, 0x00, 0x00, 0x5e, 0xa0, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x3e, 0xb6, 0xb7, 0x54, 0x7d, 0xe5, 0x4c, 0xef, 0xfe, 0xd6, 0x00, 0x02, 0x45, 0x20, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x09, 0xfb, 0x00, 0x00, 0x00, 0x5e, 0xeb, 0x00, 0x00, 0x01, 0xdb, 0xdb, 0x00, 0x00, 0x0a, 0xd2, 0xdb, 0x00, 0x00, 0x6e, 0x60, 0xdb, 0x00, 0x02, 0xda, 0x00, 0xdb, 0x00, 0x0b, 0xd1, 0x00, 0xdb, 0x00, 0x7e, 0x64, 0x44, 0xdb, 0x42, 0xbf, 0xff, 0xff, 0xff, 0xf8, 0x56, 0x66, 0x66, 0xdc, 0x64, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x15, 0x55, 0x55, 0x40, 0x6f, 0xff, 0xff, 0xe0, 0x7f, 0x76, 0x66, 0x60, 0x9e, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0xae, 0x89, 0x84, 0x00, 0xae, 0xdd, 0xee, 0xa0, 0x01, 0x00, 0x2a, 0xf8, 0x00, 0x00, 0x01, 0xec, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x04, 0xea, 0xb8, 0x64, 0x7d, 0xe4, 0xbe, 0xff, 0xec, 0x50, 0x01, 0x45, 0x20, 0x00, 0x00, 0x00, 0x26, 0x76, 0x00, 0x01, 0xae, 0xee, 0xe0, 0x00, 0xbe, 0x82, 0x02, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x0b, 0xd1, 0x00, 0x00, 0x00, 0xdb, 0x49, 0xa9, 0x30, 0x0e, 0xce, 0xbb, 0xee, 0x42, 0xfe, 0x40, 0x04, 0xeb, 0x1f, 0xa0, 0x00, 0x0b, 0xd0, 0xea, 0x00, 0x00, 0xbd, 0x0b, 0xd1, 0x00, 0x0d, 0xc0, 0x5e, 0xc5, 0x5b, 0xf7, 0x00, 0x6d, 0xff, 0xe8, 0x00, 0x00, 0x04, 0x41, 0x00, 0x25, 0x55, 0x55, 0x55, 0x46, 0xff, 0xff, 0xff, 0xfe, 0x26, 0x66, 0x66, 0x6e, 0xc0, 0x00, 0x00, 0x07, 0xf6, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x6f, 0x80, 0x00, 0x00, 0x0c, 0xd1, 0x00, 0x00, 0x05, 0xe9, 0x00, 0x00, 0x00, 0xbe, 0x20, 0x00, 0x00, 0x4e, 0xa0, 0x00, 0x00, 0x0a, 0xe4, 0x00, 0x00, 0x02, 0xeb, 0x00, 0x00, 0x00, 0x9f, 0x50, 0x00, 0x00, 0x00, 0x04, 0x76, 0x20, 0x00, 0x2c, 0xfe, 0xee, 0x90, 0x0a, 0xe7, 0x01, 0xaf, 0x60, 0xcc, 0x00, 0x02, 0xf9, 0x0b, 0xd2, 0x00, 0x6f, 0x70, 0x4e, 0xd6, 0x7e, 0xb0, 0x00, 0x4e, 0xff, 0xb0, 0x00, 0x4d, 0xd9, 0xce, 0xb0, 0x0d, 0xd2, 0x00, 0x7e, 0xa4, 0xf8, 0x00, 0x00, 0xbd, 0x4f, 0x90, 0x00, 0x0c, 0xd0, 0xce, 0x73, 0x4a, 0xf9, 0x03, 0xbe, 0xff, 0xe9, 0x00, 0x00, 0x24, 0x41, 0x00, 0x00, 0x04, 0x76, 0x10, 0x00, 0x2b, 0xee, 0xfd, 0x50, 0x0b, 0xe8, 0x14, 0xce, 0x31, 0xea, 0x00, 0x04, 0xe9, 0x4f, 0x80, 0x00, 0x0c, 0xc3, 0xf9, 0x00, 0x00, 0xcd, 0x0d, 0xd3, 0x00, 0x8f, 0xd0, 0x6e, 0xec, 0xdc, 0xcc, 0x00, 0x38, 0x97, 0x0d, 0xb0, 0x00, 0x00, 0x04, 0xe8, 0x00, 0x00, 0x00, 0xbe, 0x20, 0x34, 0x36, 0xbe, 0x70, 0x07, 0xff, 0xed, 0x70, 0x00, 0x04, 0x53, 0x00, 0x00, 0x36, 0x0c, 0xf7, 0xae, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xbe, 0x5c, 0xf6, 0x25, 0x00, 0x04, 0x60, 0x0c, 0xf6, 0x0a, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xe2, 0x0d, 0xc0, 0x3f, 0x80, 0x7e, 0x20, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x05, 0xbd, 0x00, 0x00, 0x5b, 0xeb, 0x50, 0x05, 0xce, 0xb4, 0x00, 0x3c, 0xea, 0x30, 0x00, 0x03, 0xde, 0xa4, 0x00, 0x00, 0x00, 0x6c, 0xec, 0x70, 0x00, 0x00, 0x04, 0xae, 0xd9, 0x00, 0x00, 0x00, 0x29, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x17, 0x77, 0x77, 0x77, 0x62, 0xee, 0xee, 0xee, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0xee, 0xee, 0xee, 0xb1, 0x77, 0x77, 0x77, 0x76, 0x23, 0x00, 0x00, 0x00, 0x05, 0xea, 0x30, 0x00, 0x00, 0x07, 0xce, 0xa3, 0x00, 0x00, 0x00, 0x6c, 0xea, 0x30, 0x00, 0x00, 0x06, 0xce, 0x90, 0x00, 0x00, 0x6b, 0xeb, 0x00, 0x29, 0xde, 0xa4, 0x02, 0xae, 0xd9, 0x20, 0x00, 0x5c, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x57, 0x51, 0x09, 0xef, 0xff, 0xd4, 0x79, 0x52, 0x6e, 0xc0, 0x00, 0x00, 0xae, 0x00, 0x00, 0x0c, 0xd0, 0x00, 0x09, 0xf7, 0x00, 0x09, 0xe8, 0x00, 0x06, 0xe8, 0x00, 0x00, 0xac, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x11, 0x00, 0x00, 0x0d, 0xd1, 0x00, 0x00, 0xee, 0x10, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x03, 0x41, 0x00, 0x00, 0x00, 0x00, 0x06, 0xce, 0xff, 0xec, 0x70, 0x00, 0x00, 0x0a, 0xea, 0x62, 0x15, 0xae, 0xa0, 0x00, 0x0a, 0xd5, 0x00, 0x00, 0x00, 0x5e, 0x80, 0x05, 0xe6, 0x02, 0xad, 0xdc, 0x70, 0x9d, 0x00, 0xac, 0x01, 0xdd, 0x77, 0xda, 0x03, 0xf4, 0x0d, 0x80, 0x8e, 0x30, 0x0d, 0xa0, 0x0e, 0x70, 0xe6, 0x0a, 0xd0, 0x00, 0xd9, 0x00, 0xe6, 0x0e, 0x60, 0xac, 0x00, 0x2e, 0x90, 0x4e, 0x30, 0xe8, 0x07, 0xe5, 0x0a, 0xeb, 0x0b, 0xc0, 0x0c, 0xb0, 0x0b, 0xee, 0xc5, 0xde, 0xd3, 0x00, 0x7e, 0x50, 0x02, 0x30, 0x01, 0x40, 0x00, 0x00, 0xbe, 0x70, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x9e, 0xdc, 0xbc, 0xee, 0x10, 0x00, 0x00, 0x00, 0x27, 0x9a, 0x97, 0x20, 0x00, 0x00, 0x00, 0x00, 0x25, 0x20, 0x00, 0x00, 0x00, 0x0a, 0xf8, 0x00, 0x00, 0x00, 0x01, 0xee, 0xd0, 0x00, 0x00, 0x00, 0x7e, 0x8f, 0x50, 0x00, 0x00, 0x0c, 0xc1, 0xea, 0x00, 0x00, 0x04, 0xe8, 0x0a, 0xe1, 0x00, 0x00, 0x9e, 0x20, 0x5f, 0x80, 0x00, 0x0d, 0xc4, 0x44, 0xdc, 0x00, 0x06, 0xff, 0xff, 0xff, 0xe4, 0x00, 0xbd, 0x66, 0x66, 0x7e, 0xa0, 0x3e, 0xa0, 0x00, 0x00, 0xcd, 0x09, 0xe4, 0x00, 0x00, 0x08, 0xf7, 0xdc, 0x00, 0x00, 0x00, 0x1e, 0xb0, 0x25, 0x55, 0x42, 0x00, 0x00, 0x8f, 0xff, 0xff, 0xd9, 0x00, 0x8f, 0x75, 0x67, 0xcf, 0x90, 0x8f, 0x50, 0x00, 0x1e, 0xc0, 0x8f, 0x50, 0x00, 0x0e, 0xb0, 0x8f, 0x50, 0x03, 0xae, 0x60, 0x8f, 0xee, 0xef, 0xd5, 0x00, 0x8f, 0x97, 0x79, 0xce, 0x80, 0x8f, 0x50, 0x00, 0x0c, 0xe1, 0x8f, 0x50, 0x00, 0x0a, 0xf4, 0x8f, 0x50, 0x00, 0x0d, 0xe1, 0x8f, 0x97, 0x78, 0xcf, 0xa0, 0x8f, 0xff, 0xfe, 0xd9, 0x00, 0x00, 0x00, 0x57, 0x64, 0x00, 0x00, 0x8d, 0xff, 0xff, 0xd3, 0x09, 0xfc, 0x63, 0x47, 0x90, 0x5e, 0xc1, 0x00, 0x00, 0x00, 0xbe, 0x40, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x50, 0x00, 0x00, 0x00, 0x5e, 0xc2, 0x00, 0x00, 0x00, 0x0a, 0xfd, 0x86, 0x68, 0x90, 0x00, 0x8d, 0xff, 0xfe, 0xa0, 0x00, 0x00, 0x25, 0x42, 0x00, 0x25, 0x55, 0x42, 0x00, 0x00, 0x08, 0xff, 0xff, 0xfd, 0x91, 0x00, 0x8f, 0x75, 0x67, 0xbe, 0xc2, 0x08, 0xf5, 0x00, 0x00, 0x8f, 0xa0, 0x8f, 0x50, 0x00, 0x00, 0xce, 0x28, 0xf5, 0x00, 0x00, 0x08, 0xf6, 0x8f, 0x50, 0x00, 0x00, 0x7f, 0x88, 0xf5, 0x00, 0x00, 0x07, 0xf7, 0x8f, 0x50, 0x00, 0x00, 0x9f, 0x58, 0xf5, 0x00, 0x00, 0x0d, 0xd0, 0x8f, 0x50, 0x00, 0x1a, 0xf8, 0x08, 0xf9, 0x78, 0xad, 0xea, 0x00, 0x8f, 0xff, 0xed, 0xb6, 0x00, 0x00, 0x25, 0x55, 0x55, 0x53, 0x8f, 0xff, 0xff, 0xf9, 0x8f, 0x86, 0x66, 0x63, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0xff, 0xff, 0xf4, 0x8f, 0x98, 0x88, 0x82, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x98, 0x88, 0x85, 0x8f, 0xff, 0xff, 0xf9, 0x25, 0x55, 0x55, 0x53, 0x8f, 0xff, 0xff, 0xf9, 0x8f, 0x86, 0x66, 0x63, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0xba, 0xaa, 0xa2, 0x8f, 0xdd, 0xdd, 0xd3, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x00, 0x00, 0x36, 0x76, 0x30, 0x00, 0x06, 0xce, 0xff, 0xfe, 0xb0, 0x08, 0xed, 0x84, 0x35, 0x98, 0x04, 0xec, 0x20, 0x00, 0x00, 0x00, 0xae, 0x40, 0x00, 0x00, 0x00, 0x0d, 0xd0, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x02, 0x99, 0x99, 0x2e, 0xc0, 0x00, 0x3e, 0xee, 0xf4, 0xdd, 0x00, 0x00, 0x00, 0x9f, 0x4a, 0xe4, 0x00, 0x00, 0x09, 0xf4, 0x5e, 0xc2, 0x00, 0x00, 0x9f, 0x40, 0x9e, 0xd9, 0x65, 0x6b, 0xf4, 0x00, 0x7c, 0xef, 0xff, 0xec, 0x30, 0x00, 0x02, 0x45, 0x30, 0x00, 0x25, 0x10, 0x00, 0x00, 0x34, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0xff, 0xff, 0xff, 0xfe, 0x8f, 0x98, 0x88, 0x88, 0xce, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x8f, 0x50, 0x00, 0x00, 0xbe, 0x25, 0x55, 0x51, 0x6e, 0xff, 0xd2, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xeb, 0x00, 0x03, 0xec, 0x20, 0x7e, 0xff, 0xe2, 0x00, 0x03, 0x51, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf4, 0x00, 0x09, 0xf3, 0x00, 0x0a, 0xf2, 0x35, 0x7e, 0xd0, 0x8f, 0xfd, 0x50, 0x15, 0x51, 0x00, 0x25, 0x10, 0x00, 0x03, 0x52, 0x8f, 0x50, 0x00, 0x4e, 0xc1, 0x8f, 0x50, 0x03, 0xdd, 0x20, 0x8f, 0x50, 0x2d, 0xd3, 0x00, 0x8f, 0x51, 0xce, 0x40, 0x00, 0x8f, 0x5b, 0xe5, 0x00, 0x00, 0x8f, 0xcf, 0xd1, 0x00, 0x00, 0x8f, 0xea, 0xfa, 0x00, 0x00, 0x8f, 0x60, 0xbe, 0x60, 0x00, 0x8f, 0x50, 0x2d, 0xe3, 0x00, 0x8f, 0x50, 0x05, 0xec, 0x00, 0x8f, 0x50, 0x00, 0x8f, 0x90, 0x8f, 0x50, 0x00, 0x0b, 0xe5, 0x25, 0x10, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x8f, 0x98, 0x88, 0x85, 0x8f, 0xff, 0xff, 0xfa, 0x25, 0x40, 0x00, 0x00, 0x00, 0x35, 0x48, 0xff, 0x50, 0x00, 0x00, 0x0c, 0xfc, 0x8e, 0xea, 0x00, 0x00, 0x04, 0xee, 0xc8, 0xfb, 0xe1, 0x00, 0x00, 0xad, 0xcc, 0x8f, 0x6f, 0x70, 0x00, 0x0d, 0xac, 0xc8, 0xf3, 0xdb, 0x00, 0x06, 0xe4, 0xcc, 0x8f, 0x39, 0xe3, 0x00, 0xbc, 0x0c, 0xc8, 0xf3, 0x3e, 0x90, 0x2e, 0x80, 0xcc, 0x8f, 0x30, 0xcd, 0x09, 0xe2, 0x0c, 0xc8, 0xf3, 0x07, 0xf5, 0xdb, 0x00, 0xcc, 0x8f, 0x30, 0x1e, 0xcf, 0x60, 0x0c, 0xc8, 0xf3, 0x00, 0xaf, 0xd0, 0x00, 0xcc, 0x8f, 0x30, 0x05, 0xf9, 0x00, 0x0c, 0xc0, 0x25, 0x30, 0x00, 0x00, 0x15, 0x28, 0xfd, 0x10, 0x00, 0x05, 0xf7, 0x8e, 0xf9, 0x00, 0x00, 0x5f, 0x78, 0xeb, 0xe5, 0x00, 0x05, 0xf7, 0x8f, 0x3e, 0xc0, 0x00, 0x5f, 0x78, 0xf2, 0x8f, 0x90, 0x05, 0xf7, 0x8f, 0x30, 0xce, 0x40, 0x5f, 0x78, 0xf3, 0x04, 0xec, 0x05, 0xf7, 0x8f, 0x30, 0x09, 0xf8, 0x5f, 0x78, 0xf3, 0x00, 0x0c, 0xe5, 0xf7, 0x8f, 0x30, 0x00, 0x5e, 0xcf, 0x78, 0xf3, 0x00, 0x00, 0xaf, 0xf7, 0x8f, 0x30, 0x00, 0x01, 0xdf, 0x70, 0x00, 0x02, 0x67, 0x63, 0x00, 0x00, 0x00, 0x9e, 0xff, 0xfe, 0xb2, 0x00, 0x0b, 0xfb, 0x52, 0x49, 0xed, 0x20, 0x6f, 0xa0, 0x00, 0x00, 0x7f, 0xa0, 0xbe, 0x20, 0x00, 0x00, 0x0d, 0xd0, 0xdd, 0x00, 0x00, 0x00, 0x0a, 0xf4, 0xec, 0x00, 0x00, 0x00, 0x09, 0xf5, 0xec, 0x00, 0x00, 0x00, 0x09, 0xf5, 0xdd, 0x00, 0x00, 0x00, 0x0a, 0xf3, 0xbe, 0x40, 0x00, 0x00, 0x0d, 0xd0, 0x5e, 0xb0, 0x00, 0x00, 0x8f, 0x90, 0x0a, 0xfc, 0x75, 0x7b, 0xec, 0x10, 0x00, 0x8d, 0xff, 0xfe, 0xa1, 0x00, 0x00, 0x00, 0x35, 0x40, 0x00, 0x00, 0x25, 0x54, 0x41, 0x00, 0x08, 0xff, 0xff, 0xec, 0x40, 0x8f, 0x75, 0x7a, 0xed, 0x28, 0xf5, 0x00, 0x09, 0xf7, 0x8f, 0x50, 0x00, 0x5f, 0x88, 0xf5, 0x00, 0x08, 0xf6, 0x8f, 0x62, 0x48, 0xed, 0x18, 0xff, 0xff, 0xec, 0x30, 0x8f, 0x97, 0x63, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x08, 0xf5, 0x00, 0x00, 0x00, 0x8f, 0x50, 0x00, 0x00, 0x00, 0x00, 0x02, 0x67, 0x63, 0x00, 0x00, 0x00, 0x9e, 0xff, 0xfe, 0xb2, 0x00, 0x0b, 0xfb, 0x52, 0x49, 0xed, 0x20, 0x6f, 0xa0, 0x00, 0x00, 0x7f, 0xa0, 0xbe, 0x20, 0x00, 0x00, 0x0d, 0xd0, 0xdd, 0x00, 0x00, 0x00, 0x0a, 0xf4, 0xec, 0x00, 0x00, 0x00, 0x09, 0xf5, 0xec, 0x00, 0x00, 0x00, 0x09, 0xf5, 0xdd, 0x00, 0x00, 0x00, 0x0a, 0xf3, 0xbe, 0x40, 0x00, 0x00, 0x0d, 0xd0, 0x5e, 0xb0, 0x00, 0x00, 0x8f, 0x90, 0x0a, 0xfc, 0x75, 0x7b, 0xec, 0x10, 0x00, 0x8d, 0xff, 0xfe, 0xa1, 0x00, 0x00, 0x00, 0x35, 0xbe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x03, 0xdd, 0x50, 0x25, 0x55, 0x41, 0x00, 0x00, 0x8f, 0xff, 0xfe, 0xc5, 0x00, 0x8f, 0x85, 0x69, 0xee, 0x20, 0x8f, 0x50, 0x00, 0x8f, 0x70, 0x8f, 0x50, 0x00, 0x6f, 0x80, 0x8f, 0x50, 0x00, 0x9f, 0x60, 0x8f, 0x97, 0x8b, 0xea, 0x00, 0x8f, 0xee, 0xef, 0x80, 0x00, 0x8f, 0x50, 0x4e, 0xa0, 0x00, 0x8f, 0x50, 0x0a, 0xe5, 0x00, 0x8f, 0x50, 0x02, 0xec, 0x00, 0x8f, 0x50, 0x00, 0x8f, 0x80, 0x8f, 0x50, 0x00, 0x0c, 0xe3, 0x00, 0x04, 0x76, 0x40, 0x00, 0x3c, 0xff, 0xff, 0xd3, 0x0c, 0xe8, 0x44, 0x7a, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0xaf, 0xa3, 0x00, 0x00, 0x01, 0xae, 0xeb, 0x50, 0x00, 0x00, 0x4a, 0xee, 0xa0, 0x00, 0x00, 0x02, 0xbf, 0x70, 0x00, 0x00, 0x04, 0xfa, 0x00, 0x00, 0x00, 0x4f, 0x94, 0xb8, 0x65, 0x8d, 0xe3, 0x3d, 0xef, 0xfe, 0xc5, 0x00, 0x02, 0x55, 0x20, 0x00, 0x45, 0x55, 0x55, 0x55, 0x52, 0xdf, 0xff, 0xff, 0xff, 0xf7, 0x56, 0x66, 0xfb, 0x66, 0x62, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x00, 0x02, 0xfa, 0x00, 0x00, 0x35, 0x10, 0x00, 0x00, 0x34, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x30, 0x00, 0x00, 0xbd, 0x9f, 0x50, 0x00, 0x00, 0xcd, 0x5f, 0xa0, 0x00, 0x04, 0xea, 0x0b, 0xeb, 0x75, 0x8d, 0xe3, 0x01, 0xae, 0xff, 0xec, 0x40, 0x00, 0x01, 0x44, 0x20, 0x00, 0x43, 0x00, 0x00, 0x00, 0x35, 0x1d, 0xd0, 0x00, 0x00, 0x0b, 0xe2, 0x9f, 0x50, 0x00, 0x02, 0xeb, 0x03, 0xea, 0x00, 0x00, 0x8f, 0x70, 0x0c, 0xd0, 0x00, 0x0c, 0xe1, 0x00, 0x8f, 0x60, 0x03, 0xea, 0x00, 0x02, 0xeb, 0x00, 0x9f, 0x50, 0x00, 0x0b, 0xe1, 0x0c, 0xd0, 0x00, 0x00, 0x7f, 0x74, 0xe9, 0x00, 0x00, 0x01, 0xeb, 0x9e, 0x40, 0x00, 0x00, 0x0a, 0xec, 0xc0, 0x00, 0x00, 0x00, 0x6f, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xde, 0x30, 0x00, 0x00, 0x44, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x53, 0xbe, 0x10, 0x00, 0x4f, 0xd0, 0x00, 0x05, 0xf9, 0x8f, 0x60, 0x00, 0x9e, 0xf4, 0x00, 0x09, 0xf5, 0x4f, 0x90, 0x00, 0xcc, 0xe9, 0x00, 0x0c, 0xe0, 0x0d, 0xc0, 0x02, 0xe9, 0xcc, 0x00, 0x0e, 0xb0, 0x0a, 0xe1, 0x07, 0xf5, 0x9e, 0x20, 0x5f, 0x80, 0x07, 0xf6, 0x0b, 0xd0, 0x4f, 0x80, 0x9f, 0x40, 0x02, 0xea, 0x0e, 0xa0, 0x0d, 0xb0, 0xcd, 0x00, 0x00, 0xdc, 0x5f, 0x70, 0x0a, 0xe1, 0xea, 0x00, 0x00, 0xae, 0x9e, 0x20, 0x06, 0xf8, 0xf7, 0x00, 0x00, 0x6f, 0xdc, 0x00, 0x01, 0xed, 0xe2, 0x00, 0x00, 0x1e, 0xe9, 0x00, 0x00, 0xbe, 0xc0, 0x00, 0x00, 0x0c, 0xf4, 0x00, 0x00, 0x8f, 0xa0, 0x00, 0x35, 0x10, 0x00, 0x01, 0x53, 0x7f, 0x90, 0x00, 0x09, 0xe6, 0x0b, 0xe4, 0x00, 0x4e, 0xa0, 0x03, 0xec, 0x00, 0xcd, 0x20, 0x00, 0x7f, 0x77, 0xe6, 0x00, 0x00, 0x0c, 0xdd, 0xb0, 0x00, 0x00, 0x04, 0xee, 0x20, 0x00, 0x00, 0x09, 0xee, 0x80, 0x00, 0x00, 0x4e, 0x9b, 0xe3, 0x00, 0x00, 0xcd, 0x13, 0xeb, 0x00, 0x08, 0xe6, 0x00, 0x8f, 0x70, 0x3e, 0xb0, 0x00, 0x0c, 0xe2, 0xbe, 0x30, 0x00, 0x05, 0xeb, 0x44, 0x00, 0x00, 0x01, 0x53, 0xbe, 0x30, 0x00, 0x08, 0xf7, 0x4e, 0xa0, 0x00, 0x1d, 0xc0, 0x0b, 0xe4, 0x00, 0x9e, 0x50, 0x03, 0xeb, 0x02, 0xeb, 0x00, 0x00, 0xae, 0x4a, 0xe4, 0x00, 0x00, 0x2e, 0xce, 0xa0, 0x00, 0x00, 0x09, 0xfe, 0x30, 0x00, 0x00, 0x01, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x15, 0x55, 0x55, 0x55, 0x40, 0x5f, 0xff, 0xff, 0xff, 0xe0, 0x26, 0x66, 0x66, 0x8f, 0xa0, 0x00, 0x00, 0x01, 0xdd, 0x20, 0x00, 0x00, 0x0a, 0xe6, 0x00, 0x00, 0x00, 0x5e, 0xb0, 0x00, 0x00, 0x01, 0xdd, 0x20, 0x00, 0x00, 0x09, 0xe7, 0x00, 0x00, 0x00, 0x5e, 0xb0, 0x00, 0x00, 0x01, 0xdd, 0x20, 0x00, 0x00, 0x09, 0xe7, 0x00, 0x00, 0x00, 0x5e, 0xd8, 0x88, 0x88, 0x81, 0x8f, 0xff, 0xff, 0xff, 0xf3, 0x35, 0x55, 0x1b, 0xff, 0xf5, 0xbd, 0x33, 0x1b, 0xd0, 0x00, 0xbd, 0x00, 0x0b, 0xd0, 0x00, 0xbd, 0x00, 0x0b, 0xd0, 0x00, 0xbd, 0x00, 0x0b, 0xd0, 0x00, 0xbd, 0x00, 0x0b, 0xd0, 0x00, 0xbd, 0x00, 0x0b, 0xd0, 0x00, 0xbe, 0xaa, 0x39, 0xcc, 0xc4, 0x43, 0x00, 0x00, 0x0b, 0xd0, 0x00, 0x00, 0x6f, 0x60, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x00, 0x4e, 0x80, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x08, 0xe4, 0x00, 0x00, 0x2e, 0xa0, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x06, 0xf6, 0x00, 0x00, 0x0d, 0xb0, 0x00, 0x00, 0xae, 0x20, 0x35, 0x55, 0x2b, 0xff, 0xf6, 0x23, 0x7f, 0x60, 0x06, 0xf6, 0x00, 0x6f, 0x60, 0x06, 0xf6, 0x00, 0x6f, 0x60, 0x06, 0xf6, 0x00, 0x6f, 0x60, 0x06, 0xf6, 0x00, 0x6f, 0x60, 0x06, 0xf6, 0x00, 0x6f, 0x60, 0x06, 0xf6, 0x7a, 0xbf, 0x68, 0xcc, 0xc5, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x04, 0xe9, 0x00, 0x00, 0x00, 0x0a, 0xde, 0x20, 0x00, 0x00, 0x3e, 0x5c, 0xa0, 0x00, 0x00, 0xac, 0x06, 0xe3, 0x00, 0x02, 0xe7, 0x00, 0xca, 0x00, 0x09, 0xd0, 0x00, 0x6e, 0x40, 0x1e, 0x80, 0x00, 0x0c, 0xb0, 0x49, 0x20, 0x00, 0x05, 0x90, 0x19, 0x99, 0x99, 0x99, 0x71, 0xbb, 0xbb, 0xbb, 0xb8, 0x01, 0x00, 0x04, 0xec, 0x00, 0x06, 0xe8, 0x00, 0x06, 0xb1, 0x00, 0x03, 0x65, 0x20, 0x00, 0x3c, 0xfe, 0xee, 0x70, 0x00, 0x95, 0x13, 0xce, 0x00, 0x00, 0x00, 0x08, 0xf4, 0x00, 0x26, 0x89, 0xbf, 0x50, 0x7e, 0xec, 0xbc, 0xf5, 0x3e, 0xc1, 0x00, 0x8f, 0x55, 0xf8, 0x00, 0x0a, 0xf5, 0x3e, 0xc4, 0x49, 0xef, 0x50, 0x8e, 0xff, 0xc5, 0xe5, 0x00, 0x25, 0x30, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x36, 0x50, 0x00, 0xae, 0x9e, 0xef, 0xd5, 0x0a, 0xed, 0x51, 0x6e, 0xd1, 0xaf, 0x60, 0x00, 0x8f, 0x7a, 0xe1, 0x00, 0x04, 0xf9, 0xae, 0x00, 0x00, 0x2f, 0xaa, 0xf2, 0x00, 0x05, 0xf9, 0xaf, 0x70, 0x00, 0x9f, 0x6a, 0xed, 0x74, 0x8e, 0xc0, 0xab, 0x8e, 0xff, 0xc4, 0x00, 0x00, 0x14, 0x30, 0x00, 0x00, 0x01, 0x66, 0x40, 0x00, 0x8e, 0xff, 0xf9, 0x07, 0xfb, 0x43, 0x74, 0x0c, 0xd0, 0x00, 0x00, 0x0e, 0xa0, 0x00, 0x00, 0x2f, 0xa0, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, 0x0c, 0xd1, 0x00, 0x00, 0x07, 0xfc, 0x65, 0x87, 0x00, 0x8e, 0xff, 0xe8, 0x00, 0x00, 0x44, 0x20, 0x00, 0x00, 0x00, 0x09, 0xe1, 0x00, 0x00, 0x00, 0x0a, 0xf1, 0x00, 0x00, 0x00, 0x0a, 0xf1, 0x00, 0x03, 0x65, 0x0a, 0xf1, 0x00, 0xae, 0xef, 0xda, 0xf1, 0x09, 0xfa, 0x23, 0xae, 0xf1, 0x0d, 0xd0, 0x00, 0x0d, 0xf1, 0x1e, 0xb0, 0x00, 0x0a, 0xf1, 0x2f, 0xa0, 0x00, 0x0a, 0xf1, 0x1e, 0xb0, 0x00, 0x0a, 0xf1, 0x0d, 0xd0, 0x00, 0x0d, 0xf1, 0x08, 0xfb, 0x55, 0xae, 0xf1, 0x00, 0x9e, 0xff, 0xb8, 0xf1, 0x00, 0x02, 0x52, 0x00, 0x00, 0x00, 0x02, 0x66, 0x20, 0x00, 0x08, 0xee, 0xee, 0x80, 0x07, 0xfa, 0x22, 0xbe, 0x50, 0xcd, 0x00, 0x02, 0xea, 0x0e, 0xc9, 0x99, 0x9e, 0xc2, 0xfd, 0xcc, 0xcc, 0xca, 0x0e, 0xb0, 0x00, 0x00, 0x00, 0xce, 0x20, 0x00, 0x00, 0x06, 0xec, 0x74, 0x69, 0x60, 0x07, 0xdf, 0xff, 0xd6, 0x00, 0x00, 0x35, 0x30, 0x00, 0x00, 0x5c, 0xee, 0x80, 0x0d, 0xd7, 0x74, 0x03, 0xf9, 0x00, 0x00, 0x5f, 0x94, 0x30, 0xbe, 0xff, 0xfb, 0x02, 0x5f, 0x82, 0x20, 0x05, 0xf8, 0x00, 0x00, 0x5f, 0x80, 0x00, 0x05, 0xf8, 0x00, 0x00, 0x5f, 0x80, 0x00, 0x05, 0xf8, 0x00, 0x00, 0x5f, 0x80, 0x00, 0x05, 0xf8, 0x00, 0x00, 0x00, 0x03, 0x65, 0x01, 0x40, 0x00, 0xae, 0xef, 0xd8, 0xf1, 0x08, 0xfa, 0x22, 0x9e, 0xf1, 0x0c, 0xd0, 0x00, 0x0c, 0xf1, 0x0e, 0xa0, 0x00, 0x0a, 0xf1, 0x2f, 0xa0, 0x00, 0x09, 0xf1, 0x0e, 0xb0, 0x00, 0x0a, 0xf1, 0x0c, 0xd0, 0x00, 0x0c, 0xf1, 0x07, 0xfb, 0x44, 0xae, 0xf1, 0x00, 0x9e, 0xfe, 0xca, 0xf1, 0x00, 0x02, 0x53, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0x0c, 0xd0, 0x07, 0xb7, 0x66, 0xbf, 0x90, 0x05, 0xce, 0xff, 0xd9, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x26, 0x61, 0x00, 0xae, 0x9e, 0xef, 0xe6, 0x0a, 0xed, 0x51, 0x5d, 0xd0, 0xaf, 0x60, 0x00, 0x9f, 0x3a, 0xe1, 0x00, 0x08, 0xf4, 0xae, 0x00, 0x00, 0x8f, 0x4a, 0xe0, 0x00, 0x08, 0xf4, 0xae, 0x00, 0x00, 0x8f, 0x4a, 0xe0, 0x00, 0x08, 0xf4, 0xae, 0x00, 0x00, 0x8f, 0x40, 0x58, 0x0b, 0xe2, 0x46, 0x03, 0x40, 0xae, 0x0a, 0xe0, 0xae, 0x0a, 0xe0, 0xae, 0x0a, 0xe0, 0xae, 0x0a, 0xe0, 0xae, 0x00, 0x00, 0x58, 0x00, 0x0b, 0xe2, 0x00, 0x46, 0x00, 0x03, 0x40, 0x00, 0xae, 0x00, 0x0a, 0xe0, 0x00, 0xae, 0x00, 0x0a, 0xe0, 0x00, 0xae, 0x00, 0x0a, 0xe0, 0x00, 0xae, 0x00, 0x0a, 0xe0, 0x00, 0xae, 0x00, 0x0a, 0xe0, 0x00, 0xbe, 0x06, 0x6d, 0xc0, 0xef, 0xd6, 0x01, 0x20, 0x00, 0xad, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xae, 0x00, 0x01, 0x43, 0xae, 0x00, 0x1b, 0xe5, 0xae, 0x00, 0xbe, 0x60, 0xae, 0x0a, 0xe6, 0x00, 0xae, 0x9f, 0x70, 0x00, 0xae, 0xee, 0xa0, 0x00, 0xae, 0x69, 0xe7, 0x00, 0xae, 0x00, 0xce, 0x40, 0xae, 0x00, 0x3e, 0xc1, 0xae, 0x00, 0x07, 0xea, 0xad, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0x33, 0x03, 0x65, 0x00, 0x04, 0x64, 0x00, 0xac, 0x9e, 0xef, 0xd4, 0xcf, 0xef, 0xb0, 0xae, 0xc4, 0x28, 0xfe, 0xb3, 0x2a, 0xf7, 0xaf, 0x50, 0x00, 0xde, 0x20, 0x02, 0xf9, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0xae, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xea, 0x33, 0x03, 0x65, 0x20, 0x0a, 0xc9, 0xee, 0xfe, 0x60, 0xae, 0xd5, 0x15, 0xdd, 0x0a, 0xf6, 0x00, 0x09, 0xf2, 0xae, 0x10, 0x00, 0x8f, 0x4a, 0xe0, 0x00, 0x08, 0xf4, 0xae, 0x00, 0x00, 0x8f, 0x4a, 0xe0, 0x00, 0x08, 0xf4, 0xae, 0x00, 0x00, 0x8f, 0x4a, 0xe0, 0x00, 0x08, 0xf4, 0x00, 0x02, 0x66, 0x30, 0x00, 0x00, 0x8e, 0xfe, 0xeb, 0x10, 0x07, 0xfa, 0x31, 0x8e, 0xa0, 0x0c, 0xd0, 0x00, 0x0a, 0xe3, 0x0e, 0xb0, 0x00, 0x07, 0xf7, 0x2f, 0xa0, 0x00, 0x06, 0xf8, 0x0e, 0xb0, 0x00, 0x07, 0xf7, 0x0c, 0xd1, 0x00, 0x0b, 0xe2, 0x05, 0xeb, 0x54, 0x9e, 0x90, 0x00, 0x7d, 0xff, 0xea, 0x10, 0x00, 0x00, 0x44, 0x10, 0x00, 0x33, 0x03, 0x65, 0x10, 0x0a, 0xc9, 0xee, 0xfd, 0x50, 0xae, 0xd5, 0x16, 0xed, 0x1a, 0xf5, 0x00, 0x08, 0xf7, 0xae, 0x00, 0x00, 0x4f, 0x9a, 0xe0, 0x00, 0x02, 0xfa, 0xae, 0x10, 0x00, 0x4f, 0x9a, 0xf7, 0x00, 0x09, 0xf6, 0xae, 0xd7, 0x47, 0xec, 0x0a, 0xe8, 0xef, 0xfc, 0x30, 0xae, 0x01, 0x43, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x65, 0x01, 0x40, 0x00, 0xae, 0xef, 0xd9, 0xf1, 0x08, 0xfa, 0x23, 0xae, 0xf1, 0x0d, 0xd0, 0x00, 0x0d, 0xf1, 0x0e, 0xb0, 0x00, 0x0a, 0xf1, 0x2f, 0xa0, 0x00, 0x0a, 0xf1, 0x1e, 0xb0, 0x00, 0x0a, 0xf1, 0x0d, 0xd0, 0x00, 0x0c, 0xf1, 0x08, 0xfb, 0x54, 0xae, 0xf1, 0x00, 0x9e, 0xfe, 0xca, 0xf1, 0x00, 0x02, 0x53, 0x0a, 0xf1, 0x00, 0x00, 0x00, 0x0a, 0xf1, 0x00, 0x00, 0x00, 0x0a, 0xf1, 0x00, 0x00, 0x00, 0x0a, 0xf1, 0x00, 0x00, 0x00, 0x02, 0x30, 0x33, 0x02, 0x65, 0xac, 0x7e, 0xfc, 0xae, 0xe9, 0x43, 0xaf, 0x80, 0x00, 0xae, 0x20, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x25, 0x65, 0x00, 0x08, 0xee, 0xef, 0xd2, 0x2e, 0xb2, 0x15, 0x80, 0x3f, 0xa0, 0x00, 0x00, 0x0b, 0xfc, 0x70, 0x00, 0x00, 0x7c, 0xfd, 0x70, 0x00, 0x00, 0x5c, 0xe5, 0x00, 0x00, 0x04, 0xf8, 0x3a, 0x63, 0x4a, 0xe5, 0x3d, 0xff, 0xfe, 0x80, 0x00, 0x35, 0x40, 0x00, 0x00, 0x51, 0x00, 0x03, 0xe3, 0x00, 0x09, 0xf5, 0x43, 0xbf, 0xff, 0xfc, 0x29, 0xf4, 0x22, 0x09, 0xf3, 0x00, 0x09, 0xf3, 0x00, 0x09, 0xf3, 0x00, 0x09, 0xf3, 0x00, 0x09, 0xf3, 0x00, 0x07, 0xfa, 0x34, 0x00, 0xbe, 0xfc, 0x00, 0x02, 0x41, 0x34, 0x00, 0x00, 0x24, 0x0b, 0xd0, 0x00, 0x09, 0xf3, 0xbd, 0x00, 0x00, 0x9f, 0x3b, 0xd0, 0x00, 0x09, 0xf3, 0xbd, 0x00, 0x00, 0x9f, 0x3b, 0xd0, 0x00, 0x09, 0xf3, 0xbd, 0x00, 0x00, 0xaf, 0x3b, 0xe1, 0x00, 0x0c, 0xf3, 0x8f, 0xa4, 0x5a, 0xef, 0x30, 0xbe, 0xfe, 0xc7, 0xf3, 0x00, 0x25, 0x30, 0x00, 0x00, 0x43, 0x00, 0x00, 0x04, 0x3c, 0xd0, 0x00, 0x05, 0xf9, 0x8f, 0x50, 0x00, 0xae, 0x32, 0xea, 0x00, 0x1e, 0xb0, 0x0b, 0xe0, 0x07, 0xf7, 0x00, 0x7f, 0x70, 0xbd, 0x00, 0x00, 0xdb, 0x2e, 0xa0, 0x00, 0x0a, 0xe8, 0xe4, 0x00, 0x00, 0x4e, 0xdc, 0x00, 0x00, 0x00, 0xcf, 0x80, 0x00, 0x44, 0x00, 0x01, 0x43, 0x00, 0x02, 0x41, 0xbe, 0x00, 0x08, 0xfc, 0x00, 0x0a, 0xe2, 0x8f, 0x50, 0x0b, 0xee, 0x20, 0x0d, 0xc0, 0x4f, 0x90, 0x1e, 0x9e, 0x70, 0x2e, 0x90, 0x0d, 0xb0, 0x7f, 0x4d, 0xb0, 0x7f, 0x50, 0x0a, 0xe0, 0xbd, 0x09, 0xe1, 0xae, 0x00, 0x07, 0xf5, 0xda, 0x05, 0xf6, 0xdb, 0x00, 0x02, 0xea, 0xf5, 0x00, 0xda, 0xe8, 0x00, 0x00, 0xce, 0xd0, 0x00, 0xae, 0xe3, 0x00, 0x00, 0x9e, 0xa0, 0x00, 0x7e, 0xc0, 0x00, 0x24, 0x10, 0x00, 0x14, 0x25, 0xeb, 0x00, 0x0b, 0xe4, 0x09, 0xe7, 0x07, 0xe8, 0x00, 0x0c, 0xd4, 0xdc, 0x00, 0x00, 0x3e, 0xee, 0x30, 0x00, 0x00, 0xbf, 0xa0, 0x00, 0x00, 0x6e, 0xce, 0x60, 0x00, 0x2d, 0xc0, 0xcd, 0x20, 0x0b, 0xe4, 0x04, 0xeb, 0x08, 0xf8, 0x00, 0x08, 0xf8, 0x43, 0x00, 0x00, 0x04, 0x3c, 0xd0, 0x00, 0x05, 0xf9, 0x8f, 0x60, 0x00, 0xae, 0x31, 0xeb, 0x00, 0x0d, 0xc0, 0x0a, 0xe2, 0x06, 0xf7, 0x00, 0x4e, 0x80, 0xbe, 0x10, 0x00, 0xcc, 0x1e, 0xa0, 0x00, 0x08, 0xe8, 0xf5, 0x00, 0x00, 0x1e, 0xdd, 0x00, 0x00, 0x00, 0xaf, 0x90, 0x00, 0x00, 0x0a, 0xe3, 0x00, 0x00, 0x02, 0xeb, 0x00, 0x00, 0x56, 0xce, 0x40, 0x00, 0x0d, 0xfe, 0x70, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x44, 0x41, 0x2f, 0xff, 0xff, 0xf6, 0x02, 0x22, 0x2d, 0xd2, 0x00, 0x00, 0x9e, 0x50, 0x00, 0x05, 0xe9, 0x00, 0x00, 0x2d, 0xc0, 0x00, 0x00, 0xbe, 0x40, 0x00, 0x07, 0xe8, 0x00, 0x00, 0x3e, 0xc5, 0x55, 0x52, 0x8f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x14, 0x00, 0x09, 0xee, 0x00, 0x6f, 0xb5, 0x00, 0x9f, 0x30, 0x00, 0x9f, 0x20, 0x00, 0x9f, 0x20, 0x00, 0xae, 0x00, 0x6a, 0xea, 0x00, 0xae, 0xc4, 0x00, 0x03, 0xdd, 0x00, 0x00, 0xaf, 0x10, 0x00, 0x9f, 0x20, 0x00, 0x9f, 0x20, 0x00, 0x8f, 0x60, 0x00, 0x3e, 0xea, 0x00, 0x04, 0xab, 0xd7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0x32, 0x22, 0x00, 0x00, 0x9e, 0xc4, 0x00, 0x27, 0xec, 0x00, 0x00, 0xbe, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x20, 0x00, 0x5e, 0xc9, 0x00, 0x09, 0xee, 0x00, 0x8f, 0x80, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xae, 0x00, 0x00, 0xcd, 0x00, 0x7c, 0xf9, 0x00, 0x7b, 0x70, 0x00, 0x00, 0x22, 0x00, 0x00, 0x12, 0xbe, 0xfd, 0x95, 0x6b, 0x5b, 0x56, 0xae, 0xfe, 0x91, 0x00, 0x00, 0x03, 0x10, ]; /// Glyph metadata for binary search pub const NOTO_SANS_17_REGULAR_GLYPHS: &[GlyphInfo] = &[ GlyphInfo { character: ' ', width: 0, height: 0, x_offset: 0, y_offset: 0, x_advance: 4, data_offset: 0, }, GlyphInfo { character: '!', width: 3, height: 14, x_offset: 1, y_offset: 1, x_advance: 5, data_offset: 0, }, GlyphInfo { character: '"', width: 5, height: 6, x_offset: 1, y_offset: 1, x_advance: 7, data_offset: 21, }, GlyphInfo { character: '#', width: 11, height: 13, x_offset: 0, y_offset: 1, x_advance: 11, data_offset: 36, }, GlyphInfo { character: '$', width: 8, height: 14, x_offset: 1, y_offset: 1, x_advance: 10, data_offset: 108, }, GlyphInfo { character: '%', width: 14, height: 14, x_offset: 0, y_offset: 1, x_advance: 14, data_offset: 164, }, GlyphInfo { character: '&', width: 13, height: 14, x_offset: 0, y_offset: 1, x_advance: 12, data_offset: 262, }, GlyphInfo { character: '\'', width: 2, height: 6, x_offset: 1, y_offset: 1, x_advance: 4, data_offset: 353, }, GlyphInfo { character: '(', width: 5, height: 16, x_offset: 0, y_offset: 1, x_advance: 5,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_24_bold.rs
frostsnap_fonts/src/noto_sans_mono_24_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 24px //! Weight: 700 //! Characters: 95 //! Line height: 25px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each) pub const NOTO_SANS_MONO_24_BOLD_DATA: &[u8] = &[ 0x45, 0x55, 0x2d, 0xff, 0xf6, 0xcf, 0xff, 0x5c, 0xff, 0xf4, 0xbf, 0xff, 0x3b, 0xff, 0xf2, 0xaf, 0xfe, 0x0a, 0xff, 0xe0, 0xaf, 0xfe, 0x09, 0xff, 0xd0, 0x8f, 0xfd, 0x08, 0xff, 0xc0, 0x47, 0x76, 0x00, 0x00, 0x00, 0x7d, 0xeb, 0x0d, 0xff, 0xf6, 0xef, 0xff, 0x7a, 0xef, 0xd2, 0x04, 0x51, 0x00, 0x45, 0x53, 0x15, 0x55, 0x2d, 0xff, 0x91, 0xff, 0xf6, 0xcf, 0xf8, 0x0e, 0xff, 0x5c, 0xff, 0x70, 0xdf, 0xf3, 0xbf, 0xf5, 0x0d, 0xff, 0x1a, 0xff, 0x40, 0xcf, 0xe0, 0x9f, 0xf2, 0x0b, 0xfd, 0x01, 0x33, 0x00, 0x23, 0x20, 0x00, 0x00, 0x04, 0x53, 0x02, 0x55, 0x00, 0x00, 0x00, 0x01, 0xef, 0x90, 0xaf, 0xe0, 0x00, 0x00, 0x00, 0x4f, 0xf7, 0x0b, 0xfc, 0x00, 0x00, 0x00, 0x07, 0xff, 0x40, 0xdf, 0xb0, 0x00, 0x00, 0x00, 0x9f, 0xe0, 0x0e, 0xf9, 0x00, 0x00, 0x89, 0x9c, 0xfe, 0x99, 0xff, 0xb9, 0x91, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0xee, 0xef, 0xfe, 0xee, 0xfe, 0xee, 0xe2, 0x00, 0x04, 0xff, 0x70, 0xbf, 0xd0, 0x00, 0x00, 0x00, 0x7f, 0xf5, 0x0d, 0xfb, 0x00, 0x00, 0x45, 0x5a, 0xfe, 0x55, 0xef, 0xa5, 0x52, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x04, 0x66, 0xef, 0xa6, 0xbf, 0xe6, 0x66, 0x30, 0x00, 0x3f, 0xf7, 0x0b, 0xfd, 0x00, 0x00, 0x00, 0x06, 0xff, 0x50, 0xdf, 0xb0, 0x00, 0x00, 0x00, 0x8f, 0xe1, 0x0e, 0xfa, 0x00, 0x00, 0x00, 0x0a, 0xfd, 0x04, 0xff, 0x70, 0x00, 0x00, 0x00, 0x00, 0x04, 0x61, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x00, 0x00, 0x03, 0x8c, 0xfa, 0x85, 0x00, 0x00, 0x9e, 0xff, 0xff, 0xff, 0xd4, 0x08, 0xff, 0xff, 0xff, 0xff, 0xe1, 0x0d, 0xff, 0xbb, 0xf6, 0x8c, 0xa0, 0x1e, 0xfe, 0x2a, 0xf2, 0x00, 0x00, 0x1e, 0xff, 0x7a, 0xf2, 0x00, 0x00, 0x0c, 0xff, 0xed, 0xf2, 0x00, 0x00, 0x04, 0xdf, 0xff, 0xfd, 0x81, 0x00, 0x00, 0x3a, 0xef, 0xff, 0xfd, 0x40, 0x00, 0x00, 0x3c, 0xff, 0xff, 0xd2, 0x00, 0x00, 0x0a, 0xf9, 0xef, 0xf8, 0x00, 0x00, 0x0a, 0xf2, 0xbf, 0xf9, 0x2a, 0x30, 0x0a, 0xf2, 0xcf, 0xf8, 0x3f, 0xec, 0xac, 0xfc, 0xff, 0xe3, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x80, 0x18, 0xce, 0xff, 0xfe, 0xc7, 0x00, 0x00, 0x00, 0x2b, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x06, 0x81, 0x00, 0x00, 0x00, 0x67, 0x50, 0x00, 0x00, 0x45, 0x40, 0x02, 0xcf, 0xff, 0xb0, 0x00, 0x5e, 0xf9, 0x00, 0xaf, 0xed, 0xff, 0x80, 0x0c, 0xfe, 0x20, 0x0d, 0xfa, 0x0c, 0xfc, 0x05, 0xef, 0x90, 0x00, 0xef, 0x80, 0xaf, 0xd0, 0xcf, 0xd1, 0x00, 0x0e, 0xf9, 0x0a, 0xfc, 0x6f, 0xf8, 0x00, 0x00, 0xcf, 0xd7, 0xef, 0xbc, 0xfd, 0x10, 0x00, 0x06, 0xef, 0xff, 0xe8, 0xff, 0x80, 0x00, 0x00, 0x06, 0xcd, 0xb5, 0xcf, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xfd, 0x3b, 0xdd, 0xb2, 0x00, 0x00, 0x07, 0xff, 0x8c, 0xff, 0xff, 0xc0, 0x00, 0x00, 0xcf, 0xd6, 0xff, 0x89, 0xff, 0x50, 0x00, 0x7f, 0xf7, 0x8f, 0xe0, 0x1e, 0xf7, 0x00, 0x0d, 0xfd, 0x09, 0xfe, 0x00, 0xef, 0x80, 0x07, 0xff, 0x70, 0x7f, 0xe4, 0x6f, 0xf6, 0x00, 0xdf, 0xd0, 0x02, 0xdf, 0xee, 0xfd, 0x10, 0x8f, 0xf7, 0x00, 0x06, 0xef, 0xfd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0x55, 0x10, 0x00, 0x00, 0x00, 0x47, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xff, 0xeb, 0x10, 0x00, 0x00, 0x00, 0x8f, 0xff, 0xef, 0xfa, 0x00, 0x00, 0x00, 0x0c, 0xff, 0x74, 0xef, 0xd0, 0x00, 0x00, 0x00, 0xef, 0xe0, 0x0d, 0xfe, 0x00, 0x00, 0x00, 0x0d, 0xff, 0x44, 0xef, 0xd0, 0x00, 0x00, 0x00, 0xbf, 0xfa, 0xdf, 0xf8, 0x00, 0x00, 0x00, 0x05, 0xef, 0xff, 0xfc, 0x10, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xfd, 0x30, 0x22, 0x21, 0x00, 0x09, 0xff, 0xff, 0xc0, 0x0d, 0xff, 0x60, 0x06, 0xef, 0xff, 0xff, 0x83, 0xef, 0xe2, 0x00, 0xdf, 0xfb, 0x9f, 0xfe, 0xaf, 0xfd, 0x00, 0x4f, 0xfe, 0x20, 0xcf, 0xff, 0xff, 0x90, 0x07, 0xff, 0xd0, 0x03, 0xef, 0xff, 0xe3, 0x00, 0x6f, 0xfe, 0x40, 0x0b, 0xff, 0xfd, 0x00, 0x02, 0xef, 0xfe, 0xbc, 0xef, 0xff, 0xe5, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd2, 0x00, 0x09, 0xef, 0xff, 0xd8, 0x5e, 0xff, 0xb0, 0x00, 0x02, 0x56, 0x40, 0x00, 0x00, 0x00, 0x00, 0x35, 0x54, 0x9f, 0xfd, 0x8f, 0xfc, 0x7f, 0xfb, 0x6f, 0xfb, 0x5f, 0xfa, 0x3f, 0xf9, 0x03, 0x31, 0x00, 0x01, 0x55, 0x40, 0x00, 0x9f, 0xf9, 0x00, 0x5e, 0xfd, 0x10, 0x0b, 0xff, 0x70, 0x04, 0xef, 0xe1, 0x00, 0x9f, 0xfa, 0x00, 0x0c, 0xff, 0x60, 0x01, 0xef, 0xe2, 0x00, 0x6f, 0xfd, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x8f, 0xfb, 0x00, 0x09, 0xff, 0xb0, 0x00, 0x8f, 0xfb, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x6f, 0xfd, 0x00, 0x01, 0xef, 0xe3, 0x00, 0x0c, 0xff, 0x70, 0x00, 0x9f, 0xfb, 0x00, 0x03, 0xef, 0xe2, 0x00, 0x0b, 0xff, 0x90, 0x00, 0x3e, 0xfe, 0x20, 0x00, 0x8e, 0xea, 0x25, 0x53, 0x00, 0x03, 0xef, 0xd2, 0x00, 0x09, 0xff, 0xa0, 0x00, 0x1e, 0xfe, 0x40, 0x00, 0xaf, 0xfa, 0x00, 0x04, 0xff, 0xe0, 0x00, 0x0d, 0xff, 0x50, 0x00, 0xbf, 0xf9, 0x00, 0x09, 0xff, 0xb0, 0x00, 0x8f, 0xfc, 0x00, 0x06, 0xff, 0xd0, 0x00, 0x6f, 0xfd, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x8f, 0xfc, 0x00, 0x09, 0xff, 0xb0, 0x00, 0xcf, 0xf8, 0x00, 0x0e, 0xff, 0x40, 0x06, 0xff, 0xd0, 0x00, 0xbf, 0xf9, 0x00, 0x2e, 0xfe, 0x20, 0x0a, 0xff, 0x80, 0x04, 0xee, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x43, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf9, 0x00, 0x00, 0x03, 0x00, 0x0e, 0xf8, 0x00, 0x31, 0x0d, 0xdb, 0x8e, 0xfa, 0xad, 0xe6, 0x2e, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x39, 0xbc, 0xef, 0xff, 0xdb, 0xa6, 0x00, 0x05, 0xef, 0xef, 0xa0, 0x00, 0x00, 0x2d, 0xfd, 0xaf, 0xe7, 0x00, 0x00, 0xbf, 0xf7, 0x2e, 0xfe, 0x40, 0x00, 0x5c, 0xd0, 0x09, 0xe9, 0x00, 0x00, 0x00, 0x30, 0x01, 0x30, 0x00, 0x00, 0x00, 0x16, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x6c, 0xcc, 0xcf, 0xfd, 0xcc, 0xca, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x6d, 0xdd, 0xdf, 0xfe, 0xdd, 0xdb, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x15, 0x54, 0x00, 0x00, 0x01, 0x77, 0x73, 0x05, 0xff, 0xf7, 0x08, 0xff, 0xe2, 0x0a, 0xff, 0xc0, 0x0c, 0xff, 0x90, 0x0d, 0xfe, 0x30, 0x3f, 0xfc, 0x00, 0x6c, 0xc7, 0x00, 0x8e, 0xee, 0xee, 0xec, 0x9f, 0xff, 0xff, 0xfd, 0x9f, 0xff, 0xff, 0xfd, 0x23, 0x33, 0x33, 0x33, 0x7d, 0xeb, 0x0d, 0xff, 0xf6, 0xef, 0xff, 0x7a, 0xef, 0xd2, 0x04, 0x51, 0x00, 0x00, 0x00, 0x00, 0x16, 0x66, 0x00, 0x00, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xf8, 0x00, 0x00, 0x03, 0xef, 0xe2, 0x00, 0x00, 0x09, 0xff, 0xb0, 0x00, 0x00, 0x0d, 0xff, 0x60, 0x00, 0x00, 0x5f, 0xfd, 0x00, 0x00, 0x00, 0xaf, 0xf9, 0x00, 0x00, 0x01, 0xef, 0xe3, 0x00, 0x00, 0x08, 0xff, 0xc0, 0x00, 0x00, 0x0c, 0xff, 0x70, 0x00, 0x00, 0x4e, 0xfe, 0x10, 0x00, 0x00, 0x9f, 0xfa, 0x00, 0x00, 0x00, 0xdf, 0xf5, 0x00, 0x00, 0x06, 0xff, 0xd0, 0x00, 0x00, 0x0b, 0xff, 0x90, 0x00, 0x00, 0x2e, 0xfe, 0x30, 0x00, 0x00, 0x8f, 0xfb, 0x00, 0x00, 0x00, 0x24, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x86, 0x10, 0x00, 0x00, 0x05, 0xcf, 0xff, 0xfe, 0x80, 0x00, 0x04, 0xef, 0xff, 0xff, 0xfe, 0x80, 0x00, 0xcf, 0xff, 0xcb, 0xef, 0xfe, 0x20, 0x4e, 0xff, 0x90, 0x0a, 0xff, 0xf9, 0x08, 0xff, 0xe2, 0x02, 0xef, 0xff, 0xc0, 0xbf, 0xfc, 0x00, 0xaf, 0xff, 0xfe, 0x1c, 0xff, 0xb0, 0x5e, 0xff, 0xff, 0xf3, 0xcf, 0xfb, 0x0c, 0xfe, 0x9f, 0xff, 0x4d, 0xff, 0xa8, 0xff, 0x96, 0xff, 0xf5, 0xcf, 0xfb, 0xef, 0xd1, 0x7f, 0xff, 0x5b, 0xff, 0xff, 0xf6, 0x07, 0xff, 0xf4, 0xaf, 0xff, 0xfb, 0x00, 0x9f, 0xfe, 0x07, 0xff, 0xfe, 0x30, 0x0b, 0xff, 0xc0, 0x3e, 0xff, 0xd0, 0x04, 0xef, 0xf9, 0x00, 0xaf, 0xff, 0xcb, 0xef, 0xfe, 0x30, 0x02, 0xcf, 0xff, 0xff, 0xfe, 0x80, 0x00, 0x03, 0xbe, 0xff, 0xfd, 0x70, 0x00, 0x00, 0x00, 0x25, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x55, 0x30, 0x00, 0x00, 0x03, 0xae, 0xff, 0xa0, 0x00, 0x02, 0x9e, 0xff, 0xff, 0xa0, 0x00, 0x5e, 0xff, 0xff, 0xff, 0xa0, 0x00, 0x1d, 0xff, 0xee, 0xff, 0xa0, 0x00, 0x07, 0xeb, 0x4e, 0xff, 0xa0, 0x00, 0x00, 0x50, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xa0, 0x00, 0x04, 0xab, 0xcf, 0xff, 0xfc, 0xa8, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x01, 0x68, 0x87, 0x20, 0x00, 0x00, 0x2a, 0xef, 0xff, 0xfe, 0xb3, 0x00, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xd2, 0x08, 0xef, 0xfe, 0xcc, 0xef, 0xff, 0x90, 0x0a, 0xea, 0x20, 0x06, 0xef, 0xfc, 0x00, 0x05, 0x00, 0x00, 0x0d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0x90, 0x00, 0x00, 0x00, 0x2d, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x1c, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xe9, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xe8, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xe6, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfe, 0xee, 0xee, 0xee, 0xe7, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x00, 0x01, 0x68, 0x86, 0x20, 0x00, 0x05, 0xbe, 0xff, 0xff, 0xea, 0x10, 0x4e, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x0b, 0xff, 0xdb, 0xce, 0xff, 0xf5, 0x03, 0xb5, 0x00, 0x07, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x01, 0xef, 0xf7, 0x00, 0x00, 0x00, 0x06, 0xff, 0xe2, 0x00, 0x05, 0x67, 0xae, 0xfe, 0x80, 0x00, 0x0d, 0xff, 0xff, 0xd7, 0x00, 0x00, 0x0d, 0xff, 0xff, 0xda, 0x30, 0x00, 0x09, 0xbb, 0xde, 0xff, 0xe4, 0x00, 0x00, 0x00, 0x06, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xfd, 0x6a, 0x50, 0x00, 0x08, 0xff, 0xfb, 0x7f, 0xfd, 0xcc, 0xdf, 0xff, 0xf6, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x4a, 0xdf, 0xff, 0xfe, 0xc7, 0x00, 0x00, 0x02, 0x46, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x55, 0x52, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x4e, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x08, 0xff, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x3e, 0xfc, 0xef, 0xf6, 0x00, 0x00, 0x00, 0xbf, 0xe6, 0xff, 0xf6, 0x00, 0x00, 0x06, 0xef, 0xb2, 0xff, 0xf6, 0x00, 0x00, 0x2d, 0xfe, 0x33, 0xff, 0xf6, 0x00, 0x00, 0xaf, 0xf9, 0x03, 0xff, 0xf6, 0x00, 0x05, 0xef, 0xd1, 0x03, 0xff, 0xf6, 0x00, 0x0c, 0xff, 0xb8, 0x89, 0xff, 0xfa, 0x85, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x19, 0x99, 0x99, 0x9a, 0xff, 0xfb, 0x96, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf6, 0x00, 0x02, 0x55, 0x55, 0x55, 0x55, 0x40, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x08, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x09, 0xff, 0xed, 0xdd, 0xdd, 0xa0, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xed, 0xdc, 0xa3, 0x00, 0x0d, 0xff, 0xff, 0xff, 0xfe, 0x50, 0x0c, 0xff, 0xee, 0xff, 0xff, 0xd1, 0x00, 0x63, 0x00, 0x6d, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x07, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x03, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x05, 0xff, 0xf9, 0x4a, 0x50, 0x00, 0x3c, 0xff, 0xf6, 0x5f, 0xfe, 0xdd, 0xef, 0xff, 0xd0, 0x5f, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x2a, 0xdf, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x03, 0x56, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x77, 0x50, 0x00, 0x00, 0x19, 0xde, 0xff, 0xfd, 0x00, 0x00, 0x4d, 0xff, 0xff, 0xff, 0xd0, 0x00, 0x2d, 0xff, 0xfe, 0xba, 0xab, 0x00, 0x0a, 0xff, 0xfa, 0x10, 0x00, 0x00, 0x01, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xff, 0x50, 0x14, 0x20, 0x00, 0x09, 0xff, 0xd4, 0xce, 0xfe, 0xc5, 0x00, 0xbf, 0xfd, 0xdf, 0xff, 0xff, 0xe3, 0x0b, 0xff, 0xff, 0xdc, 0xef, 0xff, 0xa0, 0xbf, 0xff, 0xb1, 0x03, 0xdf, 0xfd, 0x0b, 0xff, 0xe3, 0x00, 0x0a, 0xff, 0xf2, 0xaf, 0xfe, 0x00, 0x00, 0x9f, 0xff, 0x27, 0xff, 0xf4, 0x00, 0x0b, 0xff, 0xe0, 0x1e, 0xff, 0xb2, 0x05, 0xef, 0xfc, 0x00, 0x9f, 0xff, 0xed, 0xef, 0xff, 0x80, 0x01, 0xcf, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x01, 0xae, 0xff, 0xfe, 0x90, 0x00, 0x00, 0x00, 0x15, 0x65, 0x10, 0x00, 0x00, 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x1d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6c, 0xdd, 0xdd, 0xdd, 0xde, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x02, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfd, 0x10, 0x00, 0x00, 0x00, 0x6f, 0xff, 0x90, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x04, 0xef, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x02, 0xef, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x86, 0x20, 0x00, 0x00, 0x7d, 0xff, 0xff, 0xea, 0x20, 0x07, 0xef, 0xff, 0xff, 0xff, 0xc0, 0x0d, 0xff, 0xeb, 0xad, 0xff, 0xf6, 0x1e, 0xff, 0xa0, 0x04, 0xff, 0xf9, 0x0e, 0xff, 0x90, 0x02, 0xef, 0xf8, 0x0c, 0xff, 0xd4, 0x0b, 0xff, 0xe3, 0x05, 0xef, 0xfe, 0xcf, 0xff, 0x90, 0x00, 0x7e, 0xff, 0xff, 0xe8, 0x00, 0x00, 0x7e, 0xff, 0xff, 0xe9, 0x00, 0x09, 0xef, 0xfd, 0xdf, 0xff, 0xb0, 0x4e, 0xff, 0xc2, 0x1a, 0xff, 0xf9, 0x9f, 0xfe, 0x20, 0x00, 0xcf, 0xfd, 0xaf, 0xfd, 0x00, 0x00, 0x9f, 0xfe, 0x9f, 0xfe, 0x50, 0x01, 0xcf, 0xfd, 0x5f, 0xff, 0xeb, 0xbd, 0xff, 0xfa, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xc2, 0x00, 0x8d, 0xef, 0xff, 0xd9, 0x20, 0x00, 0x00, 0x35, 0x64, 0x00, 0x00, 0x00, 0x01, 0x68, 0x86, 0x00, 0x00, 0x00, 0x08, 0xef, 0xff, 0xfd, 0x60, 0x00, 0x08, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x03, 0xef, 0xfe, 0xcc, 0xef, 0xfe, 0x20, 0x8f, 0xff, 0x80, 0x06, 0xef, 0xf8, 0x0b, 0xff, 0xe1, 0x00, 0x0c, 0xff, 0xc0, 0xbf, 0xfd, 0x00, 0x00, 0xaf, 0xfe, 0x0b, 0xff, 0xe1, 0x00, 0x0c, 0xff, 0xf1, 0x9f, 0xff, 0x90, 0x08, 0xef, 0xff, 0x34, 0xef, 0xff, 0xdd, 0xff, 0xff, 0xf2, 0x0a, 0xff, 0xff, 0xfe, 0xbf, 0xfe, 0x00, 0x08, 0xde, 0xec, 0x6a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x7e, 0xff, 0xd0, 0x00, 0x9c, 0xbb, 0xdf, 0xff, 0xe6, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xe7, 0x00, 0x00, 0xaf, 0xff, 0xfd, 0xa3, 0x00, 0x00, 0x03, 0x66, 0x53, 0x00, 0x00, 0x00, 0x00, 0x06, 0x72, 0x0b, 0xff, 0xe3, 0xef, 0xff, 0x7d, 0xff, 0xf6, 0x6c, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xeb, 0x0d, 0xff, 0xf6, 0xef, 0xff, 0x7a, 0xef, 0xd2, 0x04, 0x51, 0x00, 0x00, 0x37, 0x60, 0x04, 0xef, 0xfa, 0x09, 0xff, 0xfd, 0x07, 0xff, 0xfc, 0x00, 0xad, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x77, 0x73, 0x05, 0xff, 0xf7, 0x08, 0xff, 0xe2, 0x0a, 0xff, 0xc0, 0x0c, 0xff, 0x90, 0x0d, 0xfe, 0x30, 0x3f, 0xfc, 0x00, 0x6c, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x6c, 0xf8, 0x00, 0x00, 0x05, 0xce, 0xff, 0x80, 0x00, 0x5b, 0xef, 0xfe, 0xb4, 0x04, 0xbe, 0xff, 0xeb, 0x40, 0x0a, 0xef, 0xfe, 0xa4, 0x00, 0x00, 0xef, 0xfe, 0x70, 0x00, 0x00, 0x0a, 0xef, 0xfe, 0xc6, 0x00, 0x00, 0x03, 0xae, 0xff, 0xfd, 0x70, 0x00, 0x00, 0x3a, 0xef, 0xff, 0xd5, 0x00, 0x00, 0x03, 0xae, 0xff, 0x80, 0x00, 0x00, 0x00, 0x29, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x35, 0x55, 0x55, 0x55, 0x55, 0x54, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x55, 0x55, 0x55, 0x55, 0x54, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0xca, 0x92, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xe9, 0x10, 0x00, 0x00, 0x00, 0xef, 0xfd, 0x81, 0x00, 0x00, 0x08, 0xdf, 0xff, 0xd8, 0x00, 0x00, 0x01, 0x8d, 0xff, 0xfd, 0x70, 0x00, 0x00, 0x18, 0xdf, 0xff, 0xd5, 0x00, 0x00, 0x03, 0xcf, 0xff, 0x80, 0x00, 0x3a, 0xef, 0xff, 0xc5, 0x04, 0xbe, 0xff, 0xfc, 0x60, 0x0b, 0xef, 0xff, 0xc6, 0x00, 0x00, 0xef, 0xec, 0x60, 0x00, 0x00, 0x0e, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x67, 0x87, 0x20, 0x00, 0x05, 0xbe, 0xff, 0xff, 0xeb, 0x20, 0x0d, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x08, 0xfe, 0xca, 0xad, 0xff, 0xf6, 0x01, 0x94, 0x00, 0x03, 0xef, 0xf9, 0x00, 0x00, 0x00, 0x02, 0xef, 0xf9, 0x00, 0x00, 0x00, 0x09, 0xff, 0xf6, 0x00, 0x00, 0x00, 0xae, 0xff, 0xc0, 0x00, 0x00, 0x1c, 0xff, 0xfb, 0x20, 0x00, 0x00, 0xaf, 0xfe, 0x90, 0x00, 0x00, 0x00, 0xef, 0xf9, 0x00, 0x00, 0x00, 0x01, 0xef, 0xf4, 0x00, 0x00, 0x00, 0x01, 0x77, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xce, 0xc4, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x05, 0xef, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x26, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x30, 0x00, 0x00, 0x00, 0x00, 0x07, 0xce, 0xff, 0xea, 0x20, 0x00, 0x00, 0x1b, 0xff, 0xed, 0xef, 0xfd, 0x30, 0x00, 0x0b, 0xfe, 0x92, 0x00, 0x7e, 0xfd, 0x00, 0x07, 0xff, 0x80, 0x00, 0x00, 0x5e, 0xf8, 0x00, 0xdf, 0xb0, 0x07, 0x98, 0x50, 0xaf, 0xd0, 0x6f, 0xf5, 0x2c, 0xff, 0xff, 0xb6, 0xfe, 0x3a, 0xfd, 0x0a, 0xfe, 0xce, 0xfb, 0x2f, 0xf6, 0xcf, 0xb1, 0xef, 0x90, 0xcf, 0xb0, 0xef, 0x8e, 0xf9, 0x5f, 0xf4, 0x0d, 0xfa, 0x0e, 0xf8, 0xef, 0x97, 0xfe, 0x10, 0xdf, 0xa1, 0xef, 0x7e, 0xf8, 0x6f, 0xe1, 0x1e, 0xf9, 0x4f, 0xf5, 0xef, 0x94, 0xff, 0x57, 0xff, 0xa8, 0xfd, 0x0d, 0xfb, 0x0d, 0xfe, 0xef, 0xfe, 0xef, 0xa0, 0xaf, 0xd0, 0x7e, 0xff, 0x9c, 0xff, 0xd2, 0x06, 0xff, 0x70, 0x48, 0x60, 0x28, 0x71, 0x00, 0x0c, 0xfd, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0xfd, 0x71, 0x00, 0x38, 0xb0, 0x00, 0x00, 0x6e, 0xff, 0xee, 0xef, 0xfe, 0x00, 0x00, 0x00, 0x3a, 0xdf, 0xff, 0xec, 0x70, 0x00, 0x00, 0x00, 0x00, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x66, 0x63, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xff, 0xb0, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xef, 0xf5, 0x00, 0x00, 0x00, 0x03, 0xef, 0xeb, 0xff, 0x90, 0x00, 0x00, 0x00, 0x8f, 0xfc, 0x8f, 0xfc, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xa4, 0xff, 0xe1, 0x00, 0x00, 0x00, 0xdf, 0xf6, 0x0d, 0xff, 0x70, 0x00, 0x00, 0x5f, 0xfe, 0x10, 0xbf, 0xfa, 0x00, 0x00, 0x09, 0xff, 0xc0, 0x08, 0xff, 0xd0, 0x00, 0x00, 0xcf, 0xfb, 0x44, 0x7f, 0xfe, 0x30, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0xaf, 0xff, 0xcc, 0xcc, 0xff, 0xfe, 0x00, 0x0d, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf5, 0x03, 0xef, 0xf6, 0x00, 0x00, 0x0e, 0xff, 0x90, 0x8f, 0xfe, 0x20, 0x00, 0x00, 0xcf, 0xfc, 0x0b, 0xff, 0xc0, 0x00, 0x00, 0x09, 0xff, 0xe2, 0x15, 0x55, 0x55, 0x43, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfe, 0xb5, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x03, 0xff, 0xfc, 0xcc, 0xef, 0xff, 0xd0, 0x3f, 0xff, 0x50, 0x02, 0xdf, 0xff, 0x23, 0xff, 0xf5, 0x00, 0x0a, 0xff, 0xe2, 0x3f, 0xff, 0x50, 0x00, 0xbf, 0xfd, 0x03, 0xff, 0xfa, 0x89, 0xbe, 0xff, 0x90, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x90, 0x03, 0xff, 0xff, 0xff, 0xff, 0xeb, 0x20, 0x3f, 0xff, 0xba, 0xbc, 0xef, 0xfc, 0x03, 0xff, 0xf5, 0x00, 0x0a, 0xff, 0xf6, 0x3f, 0xff, 0x50, 0x00, 0x6f, 0xff, 0x83, 0xff, 0xf5, 0x00, 0x07, 0xff, 0xf8, 0x3f, 0xff, 0x50, 0x02, 0xcf, 0xff, 0x63, 0xff, 0xfd, 0xdd, 0xef, 0xff, 0xd0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x03, 0xff, 0xff, 0xff, 0xed, 0xa3, 0x00, 0x00, 0x00, 0x01, 0x67, 0x87, 0x40, 0x00, 0x00, 0x3b, 0xef, 0xff, 0xfe, 0xc5, 0x00, 0x5e, 0xff, 0xff, 0xff, 0xfe, 0x40, 0x4e, 0xff, 0xfe, 0xcc, 0xdf, 0xc0, 0x0b, 0xff, 0xfa, 0x10, 0x00, 0x45, 0x04, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0x50, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xff, 0x40, 0x00, 0x00, 0x00, 0x06, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xff, 0xfa, 0x20, 0x01, 0x79, 0x00, 0x7f, 0xff, 0xfe, 0xdd, 0xef, 0xc0, 0x00, 0x9e, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7c, 0xef, 0xff, 0xec, 0x80, 0x00, 0x00, 0x02, 0x56, 0x42, 0x00, 0x00, 0x45, 0x55, 0x54, 0x10, 0x00, 0x00, 0x0e, 0xff, 0xff, 0xfe, 0xda, 0x30, 0x00, 0xef, 0xff, 0xff, 0xff, 0xfe, 0x60, 0x0e, 0xff, 0xed, 0xde, 0xff, 0xfe, 0x40, 0xef, 0xfa, 0x00, 0x2a, 0xff, 0xfb, 0x0e, 0xff, 0xa0, 0x00, 0x0b, 0xff, 0xe3, 0xef, 0xfa, 0x00, 0x00, 0x6f, 0xff, 0x8e, 0xff, 0xa0, 0x00, 0x01, 0xef, 0xfa, 0xef, 0xfa, 0x00, 0x00, 0x0e, 0xff, 0xbe, 0xff, 0xa0, 0x00, 0x00, 0xdf, 0xfb, 0xef, 0xfa, 0x00, 0x00, 0x0e, 0xff, 0xbe, 0xff, 0xa0, 0x00, 0x02, 0xef, 0xfa, 0xef, 0xfa, 0x00, 0x00, 0x7f, 0xff, 0x6e, 0xff, 0xa0, 0x00, 0x1d, 0xff, 0xe1, 0xef, 0xfa, 0x01, 0x6c, 0xff, 0xf9, 0x0e, 0xff, 0xee, 0xef, 0xff, 0xfc, 0x10, 0xef, 0xff, 0xff, 0xff, 0xfc, 0x20, 0x0e, 0xff, 0xff, 0xed, 0xb7, 0x00, 0x00, 0x15, 0x55, 0x55, 0x55, 0x55, 0x54, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xed, 0xdd, 0xdd, 0xdb, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xa8, 0x88, 0x88, 0x84, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xcb, 0xbb, 0xbb, 0xb6, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x15, 0x55, 0x55, 0x55, 0x55, 0x54, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xed, 0xdd, 0xdd, 0xdb, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xcc, 0xcc, 0xcc, 0xc6, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xa8, 0x88, 0x88, 0x84, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x87, 0x51, 0x00, 0x00, 0x00, 0x9d, 0xff, 0xff, 0xfe, 0xa2, 0x00, 0x2b, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, 0xbf, 0xff, 0xfd, 0xcc, 0xdf, 0x90, 0x06, 0xef, 0xfe, 0x60, 0x00, 0x06, 0x30, 0x0b, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x4f, 0xff, 0x90, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xff, 0x70, 0x04, 0xbb, 0xbb, 0xb6, 0x7f, 0xff, 0x60, 0x06, 0xff, 0xff, 0xf7, 0x6f, 0xff, 0x70, 0x06, 0xff, 0xff, 0xf7, 0x4f, 0xff, 0x80, 0x02, 0x66, 0xdf, 0xf7, 0x1e, 0xff, 0xb0, 0x00, 0x00, 0xdf, 0xf7, 0x0b, 0xff, 0xe4, 0x00, 0x00, 0xdf, 0xf7, 0x07, 0xff, 0xfd, 0x50, 0x00, 0xdf, 0xf7, 0x00, 0xcf, 0xff, 0xed, 0xcd, 0xef, 0xf7, 0x00, 0x2c, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x00, 0x01, 0x9d, 0xff, 0xff, 0xfd, 0xa4, 0x00, 0x00, 0x00, 0x36, 0x64, 0x30, 0x00, 0x45, 0x53, 0x00, 0x00, 0x15, 0x55, 0x2e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xc9, 0x99, 0x9a, 0xff, 0xf7, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xef, 0xfd, 0xaa, 0xaa, 0xbf, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0xef, 0xfa, 0x00, 0x00, 0x5f, 0xff, 0x7e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf7, 0x45, 0x55, 0x55, 0x55, 0x55, 0x2d, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x67, 0x9a, 0xdf, 0xfe, 0xa9, 0x83, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x00, 0x00, 0xaf, 0xfd, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd0, 0x00, 0x08, 0xab, 0xdf, 0xfe, 0xcb, 0xa4, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xff, 0xff, 0xff, 0xff, 0xf6, 0x00, 0x00, 0x00, 0x35, 0x54, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0xcf, 0xfc, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x51, 0x00, 0x09, 0xff, 0xf9, 0xee, 0xdd, 0xef, 0xff, 0xe4, 0xef, 0xff, 0xff, 0xfe, 0x90, 0xde, 0xff, 0xfe, 0xc7, 0x00, 0x02, 0x56, 0x53, 0x00, 0x00, 0x45, 0x53, 0x00, 0x00, 0x25, 0x55, 0x3e, 0xff, 0xa0, 0x00, 0x0b, 0xff, 0xe5, 0xef, 0xfa, 0x00, 0x07, 0xff, 0xf9, 0x0e, 0xff, 0xa0, 0x03, 0xef, 0xfc, 0x00, 0xef, 0xfa, 0x00, 0xbf, 0xfe, 0x40, 0x0e, 0xff, 0xa0, 0x7f, 0xff, 0x70, 0x00, 0xef, 0xfa, 0x3e, 0xff, 0xb0, 0x00, 0x0e, 0xff, 0xab, 0xff, 0xd2, 0x00, 0x00, 0xef, 0xfc, 0xef, 0xf8, 0x00, 0x00, 0x0e, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0xef, 0xff, 0xff, 0xff, 0x70, 0x00, 0x0e, 0xff, 0xe9, 0xdf, 0xfd, 0x10, 0x00, 0xef, 0xfa, 0x07, 0xff, 0xf8, 0x00, 0x0e, 0xff, 0xa0, 0x0c, 0xff, 0xe2, 0x00, 0xef, 0xfa, 0x00, 0x6f, 0xff, 0xa0, 0x0e, 0xff, 0xa0, 0x00, 0xcf, 0xfe, 0x40, 0xef, 0xfa, 0x00, 0x05, 0xef, 0xfb, 0x0e, 0xff, 0xa0, 0x00, 0x0b, 0xff, 0xe5, 0x45, 0x53, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfb, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xb0, 0x00, 0x00, 0x00, 0xdf, 0xfc, 0x33, 0x33, 0x33, 0x2d, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xcd, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x05, 0x55, 0x54, 0x00, 0x15, 0x55, 0x53, 0x2f, 0xff, 0xfc, 0x00, 0x5f, 0xff, 0xf9, 0x2f, 0xff, 0xfe, 0x00, 0x8f, 0xff, 0xf9, 0x2f, 0xff, 0xff, 0x30, 0xaf, 0xff, 0xf9, 0x2f, 0xfd, 0xff, 0x60, 0xcf, 0xdf, 0xf9, 0x2f, 0xfc, 0xff, 0x80, 0xdf, 0xcf, 0xf9, 0x2f, 0xfc, 0xef, 0xa2, 0xff, 0xbf, 0xf9, 0x2f, 0xfc, 0xcf, 0xb6, 0xfe, 0xaf, 0xf9, 0x2f, 0xfd, 0xaf, 0xd9, 0xfd, 0xaf, 0xf9, 0x2f, 0xfe, 0x8f, 0xeb, 0xfc, 0xaf, 0xf9, 0x2f, 0xfe, 0x5f, 0xfe, 0xfa, 0xbf, 0xf9, 0x2f, 0xfe, 0x1e, 0xff, 0xf8, 0xbf, 0xf9, 0x2f, 0xff, 0x2c, 0xff, 0xf5, 0xcf, 0xf9, 0x2f, 0xff, 0x3a, 0xee, 0xe1, 0xcf, 0xf9, 0x2f, 0xff, 0x30, 0x00, 0x00, 0xcf, 0xf9, 0x2f, 0xff, 0x30, 0x00, 0x00, 0xcf, 0xf9, 0x2f, 0xff, 0x30, 0x00, 0x00, 0xcf, 0xf9, 0x2f, 0xff, 0x30, 0x00, 0x00, 0xcf, 0xf9, 0x45, 0x55, 0x40, 0x00, 0x04, 0x55, 0x2e, 0xff, 0xfe, 0x20, 0x00, 0xdf, 0xf7, 0xef, 0xff, 0xf8, 0x00, 0x0d, 0xff, 0x7e, 0xff, 0xff, 0xc0, 0x00, 0xdf, 0xf7, 0xef, 0xed, 0xfe, 0x20, 0x0d, 0xff, 0x7e, 0xff, 0xaf, 0xf8, 0x00, 0xdf, 0xf7, 0xef, 0xf7, 0xff, 0xb0, 0x0d, 0xff, 0x7e, 0xff, 0x4d, 0xfe, 0x20, 0xdf, 0xf7, 0xef, 0xf5, 0xaf, 0xf7, 0x0d, 0xff, 0x7e, 0xff, 0x56, 0xff, 0xb0, 0xdf, 0xf7, 0xef, 0xf5, 0x0e, 0xfe, 0x1c, 0xff, 0x7e, 0xff, 0x50, 0xaf, 0xf7, 0xcf, 0xf7, 0xef, 0xf5, 0x06, 0xff, 0xbc, 0xff, 0x7e, 0xff, 0x50, 0x1e, 0xfe, 0xcf, 0xf7, 0xef, 0xf5, 0x00, 0xbf, 0xfe, 0xff, 0x7e, 0xff, 0x50, 0x07, 0xff, 0xff, 0xf7, 0xef, 0xf5, 0x00, 0x1e, 0xff, 0xff, 0x7e, 0xff, 0x50, 0x00, 0xbf, 0xff, 0xf7, 0x00, 0x00, 0x16, 0x88, 0x72, 0x00, 0x00, 0x00, 0x07, 0xef, 0xff, 0xfe, 0xa2, 0x00, 0x00, 0x8e, 0xff, 0xff, 0xff, 0xfc, 0x10, 0x03, 0xef, 0xfe, 0xcb, 0xef, 0xff, 0x90, 0x0a, 0xff, 0xf8, 0x00, 0x3d, 0xff, 0xe0, 0x0d, 0xff, 0xd0, 0x00, 0x08, 0xff, 0xf6, 0x2e, 0xff, 0xa0, 0x00, 0x04, 0xff, 0xf9, 0x5f, 0xff, 0x80, 0x00, 0x00, 0xef, 0xfb, 0x6f, 0xff, 0x70, 0x00, 0x00, 0xdf, 0xfb, 0x7f, 0xff, 0x70, 0x00, 0x00, 0xdf, 0xfc, 0x6f, 0xff, 0x70, 0x00, 0x00, 0xef, 0xfb, 0x5f, 0xff, 0x80, 0x00, 0x01, 0xef, 0xfa, 0x1e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf9, 0x0d, 0xff, 0xd0, 0x00, 0x09, 0xff, 0xf5, 0x09, 0xff, 0xfa, 0x00, 0x6e, 0xff, 0xd0, 0x02, 0xef, 0xff, 0xed, 0xef, 0xff, 0x80, 0x00, 0x6e, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x05, 0xce, 0xff, 0xfd, 0x80, 0x00, 0x00, 0x00, 0x02, 0x56, 0x40, 0x00, 0x00, 0x15, 0x55, 0x55, 0x43, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfe, 0xb5, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe6, 0x03, 0xff, 0xfd, 0xdd, 0xef, 0xff, 0xd1, 0x3f, 0xff, 0x70, 0x02, 0xbf, 0xff, 0x63, 0xff, 0xf7, 0x00, 0x05, 0xff, 0xf8, 0x3f, 0xff, 0x70, 0x00, 0x2f, 0xff, 0x93, 0xff, 0xf7, 0x00, 0x07, 0xff, 0xf7, 0x3f, 0xff, 0x72, 0x37, 0xdf, 0xfe, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xc2, 0x03, 0xff, 0xfe, 0xee, 0xdb, 0x70, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0x70, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x88, 0x72, 0x00, 0x00, 0x00, 0x07, 0xef, 0xff, 0xfe, 0xa2, 0x00, 0x00, 0x8e, 0xff, 0xff, 0xff, 0xfc, 0x10, 0x03, 0xef, 0xfe, 0xcb, 0xef, 0xff, 0x90, 0x0a, 0xff, 0xf8, 0x00, 0x3d, 0xff, 0xe0, 0x0d, 0xff, 0xd0, 0x00, 0x08, 0xff, 0xf6, 0x2e, 0xff, 0xa0, 0x00, 0x04, 0xff, 0xf9, 0x5f, 0xff, 0x80, 0x00, 0x00, 0xef, 0xfb, 0x6f, 0xff, 0x70, 0x00, 0x00, 0xdf, 0xfb, 0x7f, 0xff, 0x70, 0x00, 0x00, 0xdf, 0xfc, 0x6f, 0xff, 0x70, 0x00, 0x00, 0xef, 0xfb, 0x5f, 0xff, 0x80, 0x00, 0x01, 0xef, 0xfa, 0x1e, 0xff, 0xa0, 0x00, 0x05, 0xff, 0xf9, 0x0d, 0xff, 0xd0, 0x00, 0x09, 0xff, 0xf5, 0x09, 0xff, 0xfa, 0x00, 0x6e, 0xff, 0xd0, 0x02, 0xef, 0xff, 0xed, 0xef, 0xff, 0x80, 0x00, 0x6e, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x05, 0xce, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x02, 0x5b, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x01, 0xdf, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x05, 0x77, 0x72, 0x15, 0x55, 0x54, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfe, 0xb5, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x80, 0x00, 0x3f, 0xff, 0xed, 0xef, 0xff, 0xe4, 0x00, 0x3f, 0xff, 0x90, 0x19, 0xff, 0xfa, 0x00, 0x3f, 0xff, 0x90, 0x00, 0xdf, 0xfc, 0x00, 0x3f, 0xff, 0x90, 0x00, 0xdf, 0xfc, 0x00, 0x3f, 0xff, 0x90, 0x05, 0xef, 0xfa, 0x00, 0x3f, 0xff, 0xb9, 0xae, 0xff, 0xe5, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x90, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xe7, 0x00, 0x00, 0x3f, 0xff, 0xcb, 0xff, 0xf7, 0x00, 0x00, 0x3f, 0xff, 0x90, 0xcf, 0xfd, 0x10, 0x00, 0x3f, 0xff, 0x90, 0x5e, 0xff, 0x90, 0x00, 0x3f, 0xff, 0x90, 0x0b, 0xff, 0xe3, 0x00, 0x3f, 0xff, 0x90, 0x03, 0xef, 0xfb, 0x00, 0x3f, 0xff, 0x90, 0x00, 0xaf, 0xfe, 0x50, 0x3f, 0xff, 0x90, 0x00, 0x2e, 0xff, 0xc0, 0x00, 0x00, 0x47, 0x87, 0x62, 0x00, 0x00, 0x05, 0xcf, 0xff, 0xff, 0xec, 0x70, 0x05, 0xef, 0xff, 0xff, 0xff, 0xf9, 0x00, 0xcf, 0xff, 0xda, 0xbc, 0xee, 0x30, 0x0e, 0xff, 0xd1, 0x00, 0x02, 0x60, 0x00, 0xef, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xff, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0xe9, 0x20, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xfe, 0x81, 0x00, 0x00, 0x01, 0x9e, 0xff, 0xff, 0xd5, 0x00, 0x00, 0x00, 0x4c, 0xef, 0xff, 0xe5, 0x00, 0x00, 0x00, 0x05, 0xcf, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x01, 0xcf, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xf2, 0x7b, 0x60, 0x00, 0x02, 0xdf, 0xfe, 0x07, 0xff, 0xec, 0xbc, 0xef, 0xff, 0xa0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xc2, 0x03, 0xad, 0xff, 0xff, 0xfd, 0x91, 0x00, 0x00, 0x02, 0x46, 0x53, 0x00, 0x00, 0x00, 0x25, 0x55, 0x55, 0x55, 0x55, 0x55, 0x54, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x6d, 0xdd, 0xde, 0xff, 0xed, 0xdd, 0xdb, 0x00, 0x00, 0x0a, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0a,
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/widget_simulator/src/main.rs
widget_simulator/src/main.rs
#![cfg(not(target_arch = "riscv32"))] use embedded_graphics_simulator::{ OutputSettingsBuilder, SimulatorDisplay, SimulatorEvent, Window, }; use std::cell::RefCell; use std::io::{self, BufRead}; use std::rc::Rc; use std::sync::mpsc; use std::thread; use std::time::SystemTime; const SCREEN_WIDTH: u32 = 240; const SCREEN_HEIGHT: u32 = 280; #[derive(Debug)] enum Command { Touch { x: i32, y: i32 }, Release { x: i32, y: i32 }, Drag { _x1: i32, y1: i32, x2: i32, y2: i32 }, Screenshot { filename: String }, Wait { ms: u64 }, Quit, } #[allow(clippy::collapsible_if)] fn parse_command(line: &str) -> Option<Command> { let parts: Vec<&str> = line.split_whitespace().collect(); if parts.is_empty() { return None; } match parts[0] { "touch" => { if parts.len() >= 2 { let coords: Vec<&str> = parts[1].split(',').collect(); if coords.len() == 2 { if let (Ok(x), Ok(y)) = (coords[0].parse(), coords[1].parse()) { return Some(Command::Touch { x, y }); } } } } "release" => { if parts.len() >= 2 { let coords: Vec<&str> = parts[1].split(',').collect(); if coords.len() == 2 { if let (Ok(x), Ok(y)) = (coords[0].parse(), coords[1].parse()) { return Some(Command::Release { x, y }); } } } } "drag" => { if parts.len() >= 3 { let start_coords: Vec<&str> = parts[1].split(',').collect(); let end_coords: Vec<&str> = parts[2].split(',').collect(); if start_coords.len() == 2 && end_coords.len() == 2 { if let (Ok(x1), Ok(y1), Ok(x2), Ok(y2)) = ( start_coords[0].parse(), start_coords[1].parse(), end_coords[0].parse(), end_coords[1].parse(), ) { return Some(Command::Drag { _x1: x1, y1, x2, y2, }); } } } } "screenshot" => { if parts.len() >= 2 { return Some(Command::Screenshot { filename: parts[1].to_string(), }); } } "wait" => { if parts.len() >= 2 { if let Ok(ms) = parts[1].parse() { return Some(Command::Wait { ms }); } } } "quit" => return Some(Command::Quit), _ => {} } None } fn main() -> Result<(), Box<dyn std::error::Error>> { // Parse timeout argument if provided let timeout_ms = std::env::args() .position(|arg| arg == "--timeout") .and_then(|i| std::env::args().nth(i + 1)) .and_then(|s| s.parse::<u64>().ok()); // Create display let display = Rc::new(RefCell::new(SimulatorDisplay::<Rgb565>::new(Size::new( SCREEN_WIDTH, SCREEN_HEIGHT, )))); // Clear display with background color display.borrow_mut().clear(PALETTE.background)?; // Create output settings with proper RGB color and scaling // Device is 3.75cm (37.5mm) tall with 280 pixels = 0.134mm/pixel // For a typical 96 DPI monitor (3.78 pixels/mm), life size would be scale ~0.5 // But that's too small, so we use scale 1 for a more practical size // Scale 1 = 240x280 pixels on screen (about 6.3cm x 7.4cm on a 96 DPI monitor) let output_settings = OutputSettingsBuilder::new() .scale(1) // Life-size would be ~0.5, but 1 is more practical .pixel_spacing(0) // No spacing between pixels .build(); // Create window let mut window = Window::new("Frostsnap Widget Simulator", &output_settings); // Create channel for stdin commands let (tx, rx) = mpsc::channel(); // Spawn thread to read stdin thread::spawn(move || { let stdin = io::stdin(); for line in stdin.lock().lines() { let line: Result<String, _> = line; let line: String = match line { Ok(line) => line.trim().to_owned(), Err(e) => { eprintln!("failed to read command: {e}"); return; } }; if line.is_empty() { continue; } match parse_command(&line) { Some(cmd) => { if tx.send(cmd).is_err() { break; } } None => { eprintln!("Failed to parse command: '{}'", line); std::process::exit(1); } } } }); // Macro to run a widget with all the boilerplate handling macro_rules! run_widget { ($widget:expr) => {{ let mut widget = $widget; // Set constraints on root widget widget.set_constraints(Size::new(240, 280)); let mut last_touch: Option<Point> = None; let mut drag_start: Option<Point> = None; // Initial position when mouse down let mut is_dragging = false; const DRAG_THRESHOLD: i32 = 5; // Minimum pixels to consider it a drag let start_time = SystemTime::now(); let mut touch_feedback: Vec<(Point, u8)> = Vec::new(); // Point and frames remaining let mut wait_until: Option<u64> = None; // Time to wait until before processing next command // Initial draw and update to initialize the window let _initial_time = Instant::from_millis(0); window.update(&display.borrow()); 'running: loop { let elapsed = SystemTime::now() .duration_since(start_time) .unwrap(); let elapsed_ms = elapsed.as_millis() as u64; // Check for timeout if let Some(timeout) = timeout_ms { if elapsed_ms >= timeout { println!("Timeout reached, exiting"); break 'running; } } let current_time = Instant::from_millis(elapsed_ms); // Handle stdin commands (only if not waiting) if wait_until.map_or(true, |until| current_time.as_millis() >= until) { wait_until = None; // Clear wait if let Ok(cmd) = rx.try_recv() { match cmd { Command::Touch { x, y } => { let point = Point::new(x, y); last_touch = Some(point); widget.handle_touch(point, current_time, false); // Add touch feedback touch_feedback.push((point, 30)); } Command::Release { x, y } => { let point = Point::new(x, y); if let Some(prev_point) = last_touch { widget.handle_vertical_drag(Some(prev_point.y as u32), y as u32, true); } widget.handle_touch(point, current_time, true); last_touch = None; } Command::Drag { _x1: _, y1, x2, y2 } => { widget.handle_vertical_drag(Some(y1 as u32), y2 as u32, false); last_touch = Some(Point::new(x2, y2)); } Command::Screenshot { filename } => { // First draw any pending touch feedback circles use embedded_graphics::{ primitives::{Circle, PrimitiveStyle}, pixelcolor::RgbColor, }; for (point, _) in &touch_feedback { // Draw green circle at touch point let _ = Circle::new(*point - Point::new(10, 10), 20) .into_styled(PrimitiveStyle::with_stroke(Rgb565::GREEN, 3)) .draw(&mut *display.borrow_mut()); // Also draw a filled circle in the center let _ = Circle::new(*point - Point::new(2, 2), 4) .into_styled(PrimitiveStyle::with_fill(Rgb565::GREEN)) .draw(&mut *display.borrow_mut()); } // Update window to show the circles window.update(&display.borrow()); // Save screenshot using the display's output image let output_image = display.borrow().to_rgb_output_image(&output_settings); if let Err(e) = output_image.save_png(&filename) { eprintln!("Failed to save screenshot: {}", e); } else { println!("Screenshot saved to {}", filename); } } Command::Wait { ms } => { wait_until = Some(current_time.as_millis() + ms); } Command::Quit => break 'running, } } } // Handle simulator events for event in window.events() { match event { SimulatorEvent::Quit => break 'running, SimulatorEvent::MouseButtonDown { point, .. } => { drag_start = Some(point); last_touch = Some(point); widget.handle_touch(point, current_time, false); is_dragging = false; // Don't send touch event yet - wait to see if it's a drag } SimulatorEvent::MouseButtonUp { point, .. } => { if is_dragging { // This was a drag - send final drag event with previous position let prev_y = last_touch.map(|p| p.y as u32); widget.handle_vertical_drag(prev_y, point.y as u32, true); } else { // This was a click - send touch down and up widget.handle_touch(point, current_time, true); } drag_start = None; last_touch = None; is_dragging = false; } SimulatorEvent::MouseMove { point } => { if let Some(start) = drag_start { // Check if we've moved enough to consider it a drag let distance = ((point.x - start.x).pow(2) + (point.y - start.y).pow(2)) as f32; let distance = distance.sqrt() as i32; if distance > DRAG_THRESHOLD { // Start dragging if we haven't already if !is_dragging { is_dragging = true; } // Send drag with previous position let prev_y = last_touch.map(|p| p.y as u32); widget.handle_vertical_drag(prev_y, point.y as u32, false); } last_touch = Some(point); } } _ => {} } } let mut target = SuperDrawTarget::from_shared(display.clone(), PALETTE.background); let _ = widget.draw(&mut target, current_time); // Draw touch feedback circles use embedded_graphics::{ primitives::{Circle, PrimitiveStyle}, pixelcolor::RgbColor, }; // Update and draw touch feedback touch_feedback.retain_mut(|(point, frames)| { if *frames > 0 { // Draw green circle at touch point let _ = Circle::new(*point - Point::new(10, 10), 20) .into_styled(PrimitiveStyle::with_stroke(Rgb565::GREEN, 3)) .draw(&mut *display.borrow_mut()); // Also draw a filled circle in the center let _ = Circle::new(*point - Point::new(2, 2), 4) .into_styled(PrimitiveStyle::with_fill(Rgb565::GREEN)) .draw(&mut *display.borrow_mut()); *frames -= 1; true } else { false } }); // Update window window.update(&display.borrow()); } }}; } // Select which widget to demo let demo = std::env::args().nth(1).unwrap_or("help".to_string()); // Use the demo_widget! macro for all demos (including help) frostsnap_widgets::demo_widget!(demo, run_widget); Ok(()) }
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/benchmark/benchmark.rs
benchmark/benchmark.rs
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; use compiler_builtins::float::conv::*; macro_rules! benches { ($c:ident $f:ident $builtin_conv:ident $t:ident $t2:ident $inputs:ident) => {{ #[inline(never)] fn soft_conv(x: $t) -> $t2 { $t2::from_bits(floatconv::soft::$f(x)) } #[inline(never)] fn fast_conv(x: $t) -> $t2 { floatconv::fast::$f(x) } #[inline(never)] fn builtin_conv(x: $t) -> $t2 { x as $t2 } let mut group = $c.benchmark_group(stringify!($f)); for &(input, name) in $inputs { group.bench_with_input(BenchmarkId::new("soft", name), &input, |b, &x| { b.iter(|| soft_conv(black_box(x))) }); } for &(input, name) in $inputs { group.bench_with_input(BenchmarkId::new("fast", name), &input, |b, &x| { b.iter(|| fast_conv(black_box(x))) }); } for &(input, name) in $inputs { group.bench_with_input(BenchmarkId::new("compiler_builtins", name), &input, |b, &x| { b.iter(|| $builtin_conv(black_box(x))); }); } for &(input, name) in $inputs { group.bench_with_input(BenchmarkId::new("lang", name), &input, |b, &x| { b.iter(|| builtin_conv(black_box(x))); }); } group.finish(); }}; } fn bench_u32(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(u32::max_value(), "max"), //(1234, "1234"), (1234u32 << 20 | 4321, "some-number"), ]; benches!(c u32_to_f32 __floatunsisf u32 f32 inputs); benches!(c u32_to_f64 __floatunsisf u32 f64 inputs); } fn bench_i32(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(i32::max_value(), "max"), //(1234, "1234"), (-1234i32 << 20 | 4321, "some-number"), ]; benches!(c i32_to_f32 __floatsisf i32 f32 inputs); benches!(c i32_to_f64 __floatsidf i32 f64 inputs); } fn bench_u64(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(u64::max_value(), "max"), //(1234, "1234"), (1234u64 << 45 | 4321, "some-number"), ]; benches!(c u64_to_f32 __floatundisf u64 f32 inputs); benches!(c u64_to_f64 __floatundidf u64 f64 inputs); } fn bench_i64(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(i64::max_value(), "max"), //(1234, "1234"), (-1234i64 << 45 | 4321, "some-number"), ]; benches!(c i64_to_f32 __floatdisf i64 f32 inputs); benches!(c i64_to_f64 __floatdidf i64 f64 inputs); } fn bench_u128(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(u128::max_value(), "max"), //(1234, "1234"), (1234u128 << 80 | 4321, "some-number"), ]; benches!(c u128_to_f32 __floatuntisf u128 f32 inputs); benches!(c u128_to_f64 __floatuntidf u128 f64 inputs); } fn bench_i128(c: &mut Criterion) { let inputs = &[ //(0, "zero"), //(i128::max_value(), "max"), //(1234, "1234"), (-1234i128 << 80 | 4321, "some-number"), ]; benches!(c i128_to_f32 __floattisf i128 f32 inputs); benches!(c i128_to_f64 __floattidf i128 f64 inputs); } criterion_group!(benches, bench_u32, bench_i32, bench_u64, bench_i64, bench_u128, bench_i128, ); criterion_main!(benches);
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/test.rs
src/test.rs
use crate::*; #[test] fn test_all_from_u8() { for i in 0..=u8::MAX { let a = f32::from_bits(soft::u8_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::u8_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); let i = i as i8; let a = f32::from_bits(soft::i8_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::i8_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); } } #[test] fn test_all_from_u16() { for i in 0..=u16::MAX { let a = f32::from_bits(soft::u16_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::u16_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); let i = i as i16; let a = f32::from_bits(soft::i16_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::i16_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); } } #[test] #[ignore] fn test_all_from_u32() { for i in 0..=u32::MAX { let a = f32::from_bits(soft::u32_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::u32_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); let i = i as i32; let a = f32::from_bits(soft::i32_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::i32_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); } } #[test] #[ignore] fn test_all_from_f32() { for i in 0..=u32::MAX { let f = f32::from_bits(i); let a = soft::f32_to_u8(i); let b = f as u8; assert_eq!(a, b, "{:?} -> u8", f); let a = soft::f32_to_u16(i); let b = f as u16; assert_eq!(a, b, "{:?} -> u16", f); let a = soft::f32_to_u32(i); let b = f as u32; assert_eq!(a, b, "{:?} -> u32", f); let a = soft::f32_to_u64(i); let b = f as u64; assert_eq!(a, b, "{:?} -> u64", f); let a = soft::f32_to_u128(i); let b = f as u128; assert_eq!(a, b, "{:?} -> u128", f); let a = soft::f32_to_i8(i); let b = f as i8; assert_eq!(a, b, "{:?} -> i8", f); let a = soft::f32_to_i16(i); let b = f as i16; assert_eq!(a, b, "{:?} -> i16", f); let a = soft::f32_to_i32(i); let b = f as i32; assert_eq!(a, b, "{:?} -> i32", f); let a = soft::f32_to_i64(i); let b = f as i64; assert_eq!(a, b, "{:?} -> i64", f); let a = soft::f32_to_i128(i); let b = f as i128; assert_eq!(a, b, "{:?} -> i128", f); } } #[test] fn test_u32() { for &i in &[ 0, 1, 2, 3, 1234, u32::max_value(), u32::max_value() - 1, u32::max_value() / 2, u32::min_value(), u32::min_value() + 1, u32::min_value() / 2, 123123123, 321312312, // f32: 0b100000000000000000000000000000, // Exact match, no rounding 0b100000000000000000000000100010, // Round to closest (up) 0b100000000000000000000000010010, // Round to closest (down) 0b100000000000000000000001100, // Tie, round to even (up) 0b100000000000000000000000100, // Tie, round to even (down) 1u32 << 25, 1u32 << 24, 1u32 << 23, 1u32 << 22, (1u32 << 25) - 1, (1u32 << 24) - 1, (1u32 << 23) - 1, (1u32 << 22) - 1, (1u32 << 25) + 1, (1u32 << 24) + 1, (1u32 << 23) + 1, (1u32 << 22) + 1, ][..] { assert_eq!(soft::u32_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::u32_to_f64(i), i as f64); assert_eq!(soft::u32_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::u32_to_f32(i), i as f32); assert_eq!(soft::f32_to_u32((i as f32).to_bits()), i as f32 as u32); assert_eq!(soft::f64_to_u32((i as f64).to_bits()), i as f64 as u32); } } #[test] fn test_u64() { for &i in &[ 0, 1, 2, 3, 1234, u64::max_value(), // Overflows the mantissa, should increment the exponent (which will be odd). u64::max_value() / 2, // Overflows the mantissa, should increment the exponent (which will be even). 1u64 << 63, // f32: 0b10000000000000000000000000000000000000000000000, // Exact match, no rounding 0b10000000000000000000000010001000000000000000000, // Round to closest (up) 0b10000000000000000000000001001000000000000000000, // Round to closest (down) 0b10000000000000000000000110000000000000000000, // Tie, round to even (up) 0b10000000000000000000000010000000000000000000, // Tie, round to even (down) 1u64 << 25, 1u64 << 24, 1u64 << 23, 1u64 << 22, (1u64 << 25) - 1, (1u64 << 24) - 1, (1u64 << 23) - 1, (1u64 << 22) - 1, (1u64 << 25) + 1, (1u64 << 24) + 1, (1u64 << 23) + 1, (1u64 << 22) + 1, // f64: 0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding 0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) 0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) 0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) 0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) 1u64 << 54, 1u64 << 53, 1u64 << 52, 1u64 << 51, (1u64 << 54) - 1, (1u64 << 53) - 1, (1u64 << 52) - 1, (1u64 << 51) - 1, (1u64 << 54) + 1, (1u64 << 53) + 1, (1u64 << 52) + 1, (1u64 << 51) + 1, 0b1000000000000000000000011111111111111111111111111111111111111111, 0b1111111111111111111111110111111111111111111111111111111111111111, ][..] { assert_eq!(soft::u64_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::u64_to_f32(i), i as f32); assert_eq!(soft::u64_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::u64_to_f64(i), i as f64); assert_eq!(soft::f32_to_u64((i as f32).to_bits()), i as f32 as u64); assert_eq!(soft::f64_to_u64((i as f64).to_bits()), i as f64 as u64); } } #[test] fn test_u128() { for &i in &[ 0, 1, 2, 3, 1234, u128::max_value(), // Overflows the mantissa, should increment the exponent (which will be odd). u128::max_value() / 2, // Overflows the mantissa, should increment the exponent (which will be even). 0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding 0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) 0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) 0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) 0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) // Round to closest (up), with tie-breaking bit further than 64 bits away. 0b10000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000001, // Round to closest (down), with 1-bit in 63rd position (which should be insignificant). 0b10000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000, // Round to closest (down), with 1-bits in all insignificant positions. 0b10000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111, // Mantissa of 2*52 bits, with last 32 bits set. 0b100000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111, // Mantissa of 2*52 bits, with bit 23 set. 0b100000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000, // Mantissa of 2*52 bits, with last 23 bits set. 0b100000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111, // Mantissa of 128-32 bits, with last 24 bits set. 0b1000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111, 1u128 << 127, 2u128 << 126, 3u128 << 126, 1u128 << 64, 1u128 << 63, 1u128 << 54, 1u128 << 53, 1u128 << 52, 1u128 << 51, (1u128 << 54) - 1, (1u128 << 53) - 1, (1u128 << 52) - 1, (1u128 << 51) - 1, (1u128 << 54) + 1, (1u128 << 53) + 1, (1u128 << 52) + 1, (1u128 << 51) + 1, u128::from(u64::max_value()), u128::from(u64::max_value()) << 64, u128::from(u64::max_value()) << 63, u128::from(u64::max_value()) << 53, u128::from(u64::max_value()) << 52, u128::from(u64::max_value()) << 51, u128::from(u64::max_value() >> 13) << 64, u128::from(u64::max_value() >> 13) << 63, u128::from(u64::max_value() >> 13) << 53, u128::from(u64::max_value() >> 13) << 52, u128::from(u64::max_value() >> 13) << 51, u128::from(u64::max_value() >> 12) << 64, u128::from(u64::max_value() >> 12) << 63, u128::from(u64::max_value() >> 12) << 53, u128::from(u64::max_value() >> 12) << 52, u128::from(u64::max_value() >> 12) << 51, u128::from(u64::max_value() >> 11) << 64, u128::from(u64::max_value() >> 11) << 63, u128::from(u64::max_value() >> 11) << 53, u128::from(u64::max_value() >> 11) << 52, u128::from(u64::max_value() >> 11) << 51, u128::max_value() - (u128::max_value() >> 24), u128::max_value() - (u128::max_value() >> 23), u128::max_value() - (u128::max_value() >> 22), ][..] { assert_eq!(soft::u128_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::u128_to_f32(i), i as f32); assert_eq!(soft::u128_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::u128_to_f64(i), i as f64); assert_eq!(soft::f32_to_u128((i as f32).to_bits()), i as f32 as u128); assert_eq!(soft::f64_to_u128((i as f64).to_bits()), i as f64 as u128); } } #[test] fn test_i32() { for &i in &[ 0, 1, -1, 2, -2, 3, -3, 1234, i32::max_value() - 1, i32::max_value(), i32::max_value() + 1, i32::max_value() / 2 - 1, i32::max_value() / 2, i32::max_value() / 2 + 1, 123123123, 321312312, ][..] { assert_eq!(soft::i32_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::i32_to_f64(i), i as f64); assert_eq!(soft::i32_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::i32_to_f32(i), i as f32); assert_eq!(soft::f32_to_i32((i as f32).to_bits()), i as f32 as i32); assert_eq!(soft::f64_to_i32((i as f64).to_bits()), i as f64 as i32); } } #[test] fn test_i64() { for &i in &[ 0, 1, 2, 3, 1234, -0, -1, -2, -3, -1234, i64::max_value(), i64::max_value() - 1, i64::max_value() / 2, i64::min_value(), i64::min_value() + 1, i64::min_value() / 2, 0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding 0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) 0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) 0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) 0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) -0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding -0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) -0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) -0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) -0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) 1i64 << 63, 1i64 << 54, 1i64 << 53, 1i64 << 52, 1i64 << 51, (1i64 << 54) - 1, (1i64 << 53) - 1, (1i64 << 52) - 1, (1i64 << 51) - 1, (1i64 << 54) + 1, (1i64 << 53) + 1, (1i64 << 52) + 1, (1i64 << 51) + 1, -(1i64 << 54), -(1i64 << 53), -(1i64 << 52), -(1i64 << 51), -(1i64 << 54) - 1, -(1i64 << 53) - 1, -(1i64 << 52) - 1, -(1i64 << 51) - 1, -(1i64 << 54) + 1, -(1i64 << 53) + 1, -(1i64 << 52) + 1, -(1i64 << 51) + 1, ][..] { assert_eq!(soft::i64_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::i64_to_f32(i), i as f32); assert_eq!(soft::i64_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::i64_to_f64(i), i as f64); assert_eq!(soft::f32_to_i64((i as f32).to_bits()), i as f32 as i64); assert_eq!(soft::f64_to_i64((i as f64).to_bits()), i as f64 as i64); } } #[test] fn test_i128() { for &i in &[ 0, 1, 2, 3, 1234, -0, -1, -2, -3, -1234, i128::max_value(), i128::max_value() - 1, i128::max_value() / 2, i128::min_value(), i128::min_value() + 1, i128::min_value() / 2, 0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding 0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) 0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) 0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) 0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) -0b10000000000000000000000000000000000000000000000000000000000, // Exact match, no rounding -0b10000000000000000000000000000000000000000000000000000100010, // Round to closest (up) -0b10000000000000000000000000000000000000000000000000000010010, // Round to closest (down) -0b10000000000000000000000000000000000000000000000000001100, // Tie, round to even (up) -0b10000000000000000000000000000000000000000000000000000100, // Tie, round to even (down) 1i128 << 127, 1i128 << 64, 1i128 << 63, 1i128 << 54, 1i128 << 53, 1i128 << 52, 1i128 << 51, (1i128 << 54) - 1, (1i128 << 53) - 1, (1i128 << 52) - 1, (1i128 << 51) - 1, (1i128 << 54) + 1, (1i128 << 53) + 1, (1i128 << 52) + 1, (1i128 << 51) + 1, -(1i128 << 64), -(1i128 << 63), -(1i128 << 54), -(1i128 << 53), -(1i128 << 52), -(1i128 << 51), -(1i128 << 54) - 1, -(1i128 << 53) - 1, -(1i128 << 52) - 1, -(1i128 << 51) - 1, -(1i128 << 54) + 1, -(1i128 << 53) + 1, -(1i128 << 52) + 1, -(1i128 << 51) + 1, ][..] { assert_eq!(soft::i128_to_f32(i), (i as f32).to_bits()); assert_eq!(fast::i128_to_f32(i), i as f32); assert_eq!(soft::i128_to_f64(i), (i as f64).to_bits()); assert_eq!(fast::i128_to_f64(i), i as f64); assert_eq!(soft::f32_to_i128((i as f32).to_bits()), i as f32 as i128); assert_eq!(soft::f64_to_i128((i as f64).to_bits()), i as f64 as i128); } }
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/lib.rs
src/lib.rs
#![cfg_attr(not(test), no_std)] //! Floating point conversion functions. //! //! ## Software and hardware implementations //! //! The [`soft`] module provides a software implementation of all //! conversion functions, for targets which do not provide them natively. //! These are implemented without any floating point operations, so are also //! useful for software that needs to avoid using floating point hardware. //! //! The [`fast`] module provides a fast implementation of all conversion //! functions by making use of native floating point instructions where //! possible. //! //! ## Conversion of integers to floating point values //! //! - Functions named `_round` round the integer to the closest possible //! floating point number, and breaks ties to even. //! - Functions named `_truncate` truncate the result, which means they round //! towards zero. //! - Functions without a rounding mode in their name do not round. These //! conversions are always lossless. //! - The only conversion that can overflow is `u128_to_f32_round`, in which //! case it returns `f32::INFINITY`. //! //! ## Conversion of floating point values to integers //! //! - These conversions truncate, which means they round towards zero. //! - Values higher than what the integer can represent (including +∞) result //! in the maximum integer value. //! - Values lower than what the integer can represent (including −∞) result //! in the minimum integer value. //! - `NaN` is converted to zero. //! //! ## Speed //! //! For conversions that aren't available natively, the software //! implementations in this crate seem to be both faster and smaller in almost //! all cases compared to the ones currently used by `x as <type>` (from the //! compiler builtins runtime support library). //! //! ## Work in progress //! //! This crate is usable, but still incomplete: //! //! - Native conversions are only available on ARM (32- and 64-bit) and x86 (32- and 64-bit). //! - The truncating functions do not (yet) use any native floating point instructions. // Used to group items together for #[cfg(..)]. macro_rules! group { ($($x:tt)*) => { $($x)* }; } #[cfg(test)] mod test; pub mod soft; pub mod fast; mod special;
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/soft.rs
src/soft.rs
//! Software implementations of all conversion functions that don't use any //! floating point instructions. //! //! Available on all platforms. //! //! To avoid using any floating point instructions or registers, all functions //! in this module take or return the bits of the floating point value as `u32` //! or `u64` instead of `f32` or `f64`. #[cfg_attr(not(noinline), inline)] pub fn u8_to_f32(x: u8) -> u32 { u16_to_f32(x.into()) } #[cfg_attr(not(noinline), inline)] pub fn u16_to_f32(x: u16) -> u32 { if x == 0 { return 0; } let n = x.leading_zeros(); let m = (x as u32) << (8 + n); // Significant bits, with bit 53 still in tact. let e = 141 - n; // Exponent plus 127, minus one. (e << 23) + m // Bit 24 of m will overflow into e. } #[cfg_attr(not(noinline), inline)] pub fn u32_to_f32(x: u32) -> u32 { if x == 0 { return 0; } let n = x.leading_zeros(); let a = x << n >> 8; // Significant bits, with bit 24 still in tact. let b = x << n << 24; // Insignificant bits, only relevant for rounding. let m = a + ((b - (b >> 31 & !a)) >> 31); // Add one when we need to round up. Break ties to even. let e = 157 - n as u32; // Exponent plus 127, minus one. (e << 23) + m // + not |, so the mantissa can overflow into the exponent. } #[cfg_attr(not(noinline), inline)] pub fn u64_to_f32(x: u64) -> u32 { let n = x.leading_zeros(); let y = x.wrapping_shl(n); let a = (y >> 40) as u32; // Significant bits, with bit 24 still in tact. let b = (y >> 8 | y & 0xFFFF) as u32; // Insignificant bits, only relevant for rounding. let m = a + ((b - (b >> 31 & !a)) >> 31); // Add one when we need to round up. Break ties to even. let e = if x == 0 { 0 } else { 189 - n }; // Exponent plus 127, minus one, except for zero. (e << 23) + m // + not |, so the mantissa can overflow into the exponent. } #[cfg_attr(not(noinline), inline)] pub fn u128_to_f32(x: u128) -> u32 { let n = x.leading_zeros(); let y = x.wrapping_shl(n); let a = (y >> 104) as u32; // Significant bits, with bit 24 still in tact. let b = (y >> 72) as u32 | (y << 32 >> 32 != 0) as u32; // Insignificant bits, only relevant for rounding. let m = a + ((b - (b >> 31 & !a)) >> 31); // Add one when we need to round up. Break ties to even. let e = if x == 0 { 0 } else { 253 - n }; // Exponent plus 127, minus one, except for zero. (e << 23) + m // + not |, so the mantissa can overflow into the exponent. } #[cfg_attr(not(noinline), inline)] pub fn u8_to_f64(x: u8) -> u64 { u32_to_f64(x.into()) } #[cfg_attr(not(noinline), inline)] pub fn u16_to_f64(x: u16) -> u64 { u32_to_f64(x.into()) } #[cfg_attr(not(noinline), inline)] pub fn u32_to_f64(x: u32) -> u64 { if x == 0 { return 0; } let n = x.leading_zeros(); let m = (x as u64) << (21 + n); // Significant bits, with bit 53 still in tact. let e = 1053 - n as u64; // Exponent plus 1023, minus one. (e << 52) + m // Bit 53 of m will overflow into e. } #[cfg_attr(not(noinline), inline)] pub fn u64_to_f64(x: u64) -> u64 { if x == 0 { return 0; } let n = x.leading_zeros(); let a = (x << n >> 11) as u64; // Significant bits, with bit 53 still in tact. let b = (x << n << 53) as u64; // Insignificant bits, only relevant for rounding. let m = a + ((b - (b >> 63 & !a)) >> 63); // Add one when we need to round up. Break ties to even. let e = 1085 - n as u64; // Exponent plus 1023, minus one. (e << 52) + m // + not |, so the mantissa can overflow into the exponent. } #[cfg_attr(not(noinline), inline)] pub fn u128_to_f64(x: u128) -> u64 { let n = x.leading_zeros(); let y = x.wrapping_shl(n); let a = (y >> 75) as u64; // Significant bits, with bit 53 still in tact. let b = (y >> 11 | y & 0xFFFF_FFFF) as u64; // Insignificant bits, only relevant for rounding. let m = a + ((b - (b >> 63 & !a)) >> 63); // Add one when we need to round up. Break ties to even. let e = if x == 0 { 0 } else { 1149 - n as u64 }; // Exponent plus 1023, minus one, except for zero. (e << 52) + m // + not |, so the mantissa can overflow into the exponent. } #[cfg_attr(not(noinline), inline)] pub fn i8_to_f32(i: i8) -> u32 { let sign_bit = ((i >> 7) as u32) << 31; u8_to_f32(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i16_to_f32(i: i16) -> u32 { let sign_bit = ((i >> 15) as u32) << 31; u16_to_f32(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i32_to_f32(i: i32) -> u32 { let sign_bit = ((i >> 31) as u32) << 31; u32_to_f32(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i64_to_f32(i: i64) -> u32 { let sign_bit = ((i >> 63) as u32) << 31; u64_to_f32(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i128_to_f32(i: i128) -> u32 { let sign_bit = ((i >> 127) as u32) << 31; u128_to_f32(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i8_to_f64(i: i8) -> u64 { let sign_bit = ((i >> 7) as u64) << 63; u8_to_f64(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i16_to_f64(i: i16) -> u64 { let sign_bit = ((i >> 15) as u64) << 63; u16_to_f64(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i32_to_f64(i: i32) -> u64 { let sign_bit = ((i >> 31) as u64) << 63; u32_to_f64(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i64_to_f64(i: i64) -> u64 { let sign_bit = ((i >> 63) as u64) << 63; u64_to_f64(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn i128_to_f64(i: i128) -> u64 { let sign_bit = ((i >> 127) as u64) << 63; u128_to_f64(i.unsigned_abs()) | sign_bit } #[cfg_attr(not(noinline), inline)] pub fn f32_to_u8(f: u32) -> u8 { if f < 127 << 23 { // >= 0, < 1 0 } else if f < 135 << 23 { // >= 1, < max let m = 1 << 7 | (f >> 16) as u8; // Mantissa and the implicit 1-bit. let s = 134 - (f >> 23); // Shift based on the exponent and bias. m >> s } else if f <= 255 << 23 { // >= max (incl. inf) u8::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_u16(f: u32) -> u16 { if f < 127 << 23 { // >= 0, < 1 0 } else if f < 143 << 23 { // >= 1, < max let m = 1 << 15 | (f >> 8) as u16; // Mantissa and the implicit 1-bit. let s = 142 - (f >> 23); // Shift based on the exponent and bias. m >> s } else if f <= 255 << 23 { // >= max (incl. inf) u16::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_u32(f: u32) -> u32 { if f < 127 << 23 { // >= 0, < 1 0 } else if f < 159 << 23 { // >= 1, < max let m = 1 << 31 | f << 8; // Mantissa and the implicit 1-bit. let s = 158 - (f >> 23); // Shift based on the exponent and bias. m >> s } else if f <= 255 << 23 { // >= max (incl. inf) u32::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_u64(f: u32) -> u64 { if f < 127 << 23 { // >= 0, < 1 0 } else if f < 191 << 23 { // >= 1, < max let m = 1 << 63 | (f as u64) << 40; // Mantissa and the implicit 1-bit. let s = 190 - (f >> 23); // Shift based on the exponent and bias. m >> s } else if f <= 255 << 23 { // >= max (incl. inf) u64::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_u128(f: u32) -> u128 { if f < 127 << 23 { // >= 0, < 1 0 } else if f < 255 << 23 { // >= 1, < inf let m = 1 << 127 | (f as u128) << 104; // Mantissa and the implicit 1-bit. let s = 254 - (f >> 23); // Shift based on the exponent and bias. m >> s } else if f == 255 << 23 { // == inf u128::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_u8(f: u64) -> u8 { if f < 1023 << 52 { // >= 0, < 1 0 } else if f < 1031 << 52 { // >= 1, < max let m = 1 << 7 | (f >> 45) as u8; // Mantissa and the implicit 1-bit. let s = 1030 - (f >> 52); // Shift based on the exponent and bias. m >> s } else if f <= 2047 << 52 { // >= max (incl. inf) u8::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_u16(f: u64) -> u16 { if f < 1023 << 52 { // >= 0, < 1 0 } else if f < 1039 << 52 { // >= 1, < max let m = 1 << 15 | (f >> 37) as u16; // Mantissa and the implicit 1-bit. let s = 1038 - (f >> 52); // Shift based on the exponent and bias. m >> s } else if f <= 2047 << 52 { // >= max (incl. inf) u16::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_u32(f: u64) -> u32 { if f < 1023 << 52 { // >= 0, < 1 0 } else if f < 1055 << 52 { // >= 1, < max let m = 1 << 31 | (f >> 21) as u32; // Mantissa and the implicit 1-bit. let s = 1054 - (f >> 52); // Shift based on the exponent and bias. m >> s } else if f <= 2047 << 52 { // >= max (incl. inf) u32::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_u64(f: u64) -> u64 { if f < 1023 << 52 { // >= 0, < 1 0 } else if f < 1087 << 52 { // >= 1, < max let m = 1 << 63 | f << 11; // Mantissa and the implicit 1-bit. let s = 1086 - (f >> 52); // Shift based on the exponent and bias. m >> s } else if f <= 2047 << 52 { // >= max (incl. inf) u64::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_u128(f: u64) -> u128 { if f < 1023 << 52 { // >= 0, < 1 0 } else if f < 1151 << 52 { // >= 1, < max let m = 1 << 127 | (f as u128) << 75; // Mantissa and the implicit 1-bit. let s = 1150 - (f >> 52); // Shift based on the exponent and bias. m >> s } else if f <= 2047 << 52 { // >= max (incl. inf) u128::MAX } else { // Negative or NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_i8(f: u32) -> i8 { let a = f & !0 >> 1; // Remove sign bit. if a < 127 << 23 { // >= 0, < 1 0 } else if a < 134 << 23 { // >= 1, < max let m = 1 << 7 | (a >> 16) as u8; // Mantissa and the implicit 1-bit. let s = 134 - (a >> 23); // Shift based on the exponent and bias. let u = (m >> s) as i8; // Unsigned result. if (f as i32) < 0 { -u } else { u } } else if a <= 255 << 23 { // >= max (incl. inf) if (f as i32) < 0 { i8::MIN } else { i8::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_i16(f: u32) -> i16 { let a = f & !0 >> 1; // Remove sign bit. if a < 127 << 23 { // >= 0, < 1 0 } else if a < 142 << 23 { // >= 1, < max let m = 1 << 15 | (a >> 8) as u16; // Mantissa and the implicit 1-bit. let s = 142 - (a >> 23); // Shift based on the exponent and bias. let u = (m >> s) as i16; // Unsigned result. if (f as i32) < 0 { -u } else { u } } else if a <= 255 << 23 { // >= max (incl. inf) if (f as i32) < 0 { i16::MIN } else { i16::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_i32(f: u32) -> i32 { let a = f & !0 >> 1; // Remove sign bit. if a < 127 << 23 { // >= 0, < 1 0 } else if a < 158 << 23 { // >= 1, < max let m = 1 << 31 | a << 8; // Mantissa and the implicit 1-bit. let s = 158 - (a >> 23); // Shift based on the exponent and bias. let u = (m >> s) as i32; // Unsigned result. if (f as i32) < 0 { -u } else { u } } else if a <= 255 << 23 { // >= max (incl. inf) if (f as i32) < 0 { i32::MIN } else { i32::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_i64(f: u32) -> i64 { let a = f & !0 >> 1; // Remove sign bit. if a < 127 << 23 { // >= 0, < 1 0 } else if a < 190 << 23 { // >= 1, < max let m = 1 << 63 | (a as u64) << 40; // Mantissa and the implicit 1-bit. let s = 190 - (a >> 23); // Shift based on the exponent and bias. let u = (m >> s) as i64; // Unsigned result. if (f as i32) < 0 { -u } else { u } } else if a <= 255 << 23 { // >= max (incl. inf) if (f as i32) < 0 { i64::MIN } else { i64::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f32_to_i128(f: u32) -> i128 { let a = f & !0 >> 1; // Remove sign bit. if a < 127 << 23 { // >= 0, < 1 0 } else if a < 254 << 23 { // >= 1, < max let m = 1 << 127 | (a as u128) << 104; // Mantissa and the implicit 1-bit. let s = 254 - (a >> 23); // Shift based on the exponent and bias. let u = (m >> s) as i128; // Unsigned result. if (f as i32) < 0 { -u } else { u } } else if a <= 255 << 23 { // >= max (incl. inf) if (f as i32) < 0 { i128::MIN } else { i128::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_i8(f: u64) -> i8 { let a = f & !0 >> 1; // Remove sign bit. if a < 1023 << 52 { // >= 0, < 1 0 } else if a < 1030 << 52 { // >= 1, < max let m = 1 << 7 | (a >> 45) as u8; // Mantissa and the implicit 1-bit. let s = 1030 - (a >> 52); // Shift based on the exponent and bias. let u = (m >> s) as i8; // Unsigned result. if (f as i64) < 0 { -u } else { u } } else if a <= 2047 << 52 { // >= max (incl. inf) if (f as i64) < 0 { i8::MIN } else { i8::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_i16(f: u64) -> i16 { let a = f & !0 >> 1; // Remove sign bit. if a < 1023 << 52 { // >= 0, < 1 0 } else if a < 1038 << 52 { // >= 1, < max let m = 1 << 15 | (a >> 37) as u16; // Mantissa and the implicit 1-bit. let s = 1038 - (a >> 52); // Shift based on the exponent and bias. let u = (m >> s) as i16; // Unsigned result. if (f as i64) < 0 { -u } else { u } } else if a <= 2047 << 52 { // >= max (incl. inf) if (f as i64) < 0 { i16::MIN } else { i16::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_i32(f: u64) -> i32 { let a = f & !0 >> 1; // Remove sign bit. if a < 1023 << 52 { // >= 0, < 1 0 } else if a < 1054 << 52 { // >= 1, < max let m = 1 << 31 | (a >> 21) as u32; // Mantissa and the implicit 1-bit. let s = 1054 - (a >> 52); // Shift based on the exponent and bias. let u = (m >> s) as i32; // Unsigned result. if (f as i64) < 0 { -u } else { u } } else if a <= 2047 << 52 { // >= max (incl. inf) if (f as i64) < 0 { i32::MIN } else { i32::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_i64(f: u64) -> i64 { let a = f & !0 >> 1; // Remove sign bit. if a < 1023 << 52 { // >= 0, < 1 0 } else if a < 1086 << 52 { // >= 1, < max let m = 1 << 63 | a << 11; // Mantissa and the implicit 1-bit. let s = 1086 - (a >> 52); // Shift based on the exponent and bias. let u = (m >> s) as i64; // Unsigned result. if (f as i64) < 0 { -u } else { u } } else if a <= 2047 << 52 { // >= max (incl. inf) if (f as i64) < 0 { i64::MIN } else { i64::MAX } } else { // NaN 0 } } #[cfg_attr(not(noinline), inline)] pub fn f64_to_i128(f: u64) -> i128 { let a = f & !0 >> 1; // Remove sign bit. if a < 1023 << 52 { // >= 0, < 1 0 } else if a < 1150 << 52 { // >= 1, < max let m = 1 << 127 | (a as u128) << 75; // Mantissa and the implicit 1-bit. let s = 1150 - (a >> 52); // Shift based on the exponent and bias. let u = (m >> s) as i128; // Unsigned result. if (f as i64) < 0 { -u } else { u } } else if a <= 2047 << 52 { // >= max (incl. inf) if (f as i64) < 0 { i128::MIN } else { i128::MAX } } else { // NaN 0 } }
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/special.rs
src/special.rs
//! Specialized implementations for specific targets. #[allow(unused_macros)] macro_rules! impl_signed { ($name:tt $from:tt $bits:tt $unsigned:tt) => { #[inline] pub fn $name(x: $from) -> f64 { let s = ((x >> $bits - 1) as u64) << 63; f64::from_bits($unsigned(x.wrapping_abs() as _).to_bits() | s) } }; } #[cfg(all(target_arch = "x86", not(target_feature = "sse2")))] #[inline] pub fn u32_to_f32(x: u32) -> f32 { if x >> 31 == 0 { x as i32 as f32 } else { let x = x >> 1 | x & 1; x as i32 as f32 * 2.0 } } #[cfg(all(target_arch = "x86", target_feature = "sse2"))] #[inline] pub fn u64_to_f32(x: u64) -> f32 { if x >> 63 == 0 { x as i64 as f32 } else { let x = x >> 1 | x & 0xFFFFFFFF; x as i64 as f32 * 2.0 } } #[cfg(all(target_arch = "x86", target_feature = "sse2"))] #[inline] pub fn u64_to_f64(x: u64) -> f64 { const A: f64 = (1u128 << 52) as f64; const B: f64 = (1u128 << 84) as f64; let l = f64::from_bits(A.to_bits() | x << 32 >> 32) - A; let h = f64::from_bits(B.to_bits() | x >> 32) - B; l + h } #[cfg(any( target_arch = "aarch64", target_arch = "x86_64", all(target_arch = "x86", target_feature = "sse2"), ))] group! { #[inline] pub fn u128_to_f64(x: u128) -> f64 { const A: f64 = (1u128 << 52) as f64; const B: f64 = (1u128 << 104) as f64; const C: f64 = (1u128 << 76) as f64; const D: f64 = u128::MAX as f64; if x < 1 << 104 { let l = f64::from_bits(A.to_bits() | (x << 12) as u64 >> 12) - A; let h = f64::from_bits(B.to_bits() | (x >> 52) as u64) - B; l + h } else { let l = f64::from_bits(C.to_bits() | (x >> 12) as u64 >> 12 | x as u64 & 0xFFFFFF) - C; let h = f64::from_bits(D.to_bits() | (x >> 76) as u64) - D; l + h } } impl_signed!(i128_to_f64 i128 128 u128_to_f64); }
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/fast.rs
src/fast.rs
//! Fast implementations of all conversion functions. //! //! These are implemented using a mix of native floating point instructions (if //! available) and (partial) soft implementations. #[allow(unused_macros)] macro_rules! impl_native { ($name:tt $from:tt $to:tt) => { #[cfg_attr(not(noinline), inline)] pub fn $name(x: $from) -> $to { x as $to } }; } #[allow(unused_macros)] macro_rules! impl_soft { ($name:tt $from:tt $to:tt) => { /// Soft implementation. #[inline] pub fn $name(x: $from) -> $to { let x = impl_soft!(@to_bits $from x); let y = crate::soft::$name(x); impl_soft!(@from_bits $to y) } }; (@from_bits f32 $x:tt) => { f32::from_bits($x) }; (@from_bits f64 $x:tt) => { f64::from_bits($x) }; (@from_bits $_:tt $x:tt) => { $x }; (@to_bits f32 $x:tt) => { f32::to_bits($x) }; (@to_bits f64 $x:tt) => { f64::to_bits($x) }; (@to_bits $_:tt $x:tt) => { $x }; } #[allow(unused_macros)] macro_rules! impl_special { ($name:tt $from:tt $to:tt) => { #[cfg_attr(not(noinline), inline)] pub fn $name(x: $from) -> $to { crate::special::$name(x) } }; } #[cfg(target_arch = "aarch64")] group! { impl_native!(f32_to_u32 f32 u32); impl_native!(f32_to_i32 f32 i32); impl_native!(f32_to_u64 f32 u64); impl_native!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_native!(f64_to_u32 f64 u32); impl_native!(f64_to_i32 f64 i32); impl_native!(f64_to_u64 f64 u64); impl_native!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_native!(u8_to_f32 u8 f32); impl_native!(i8_to_f32 i8 f32); impl_native!(u16_to_f32 u16 f32); impl_native!(i16_to_f32 i16 f32); impl_native!(u32_to_f32 u32 f32); impl_native!(i32_to_f32 i32 f32); impl_native!(u64_to_f32 u64 f32); impl_native!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_native!(u8_to_f64 u8 f64); impl_native!(i8_to_f64 i8 f64); impl_native!(u16_to_f64 u16 f64); impl_native!(i16_to_f64 i16 f64); impl_native!(u32_to_f64 u32 f64); impl_native!(i32_to_f64 i32 f64); impl_native!(u64_to_f64 u64 f64); impl_native!(i64_to_f64 i64 f64); impl_special!(u128_to_f64 u128 f64); impl_special!(i128_to_f64 i128 f64); } #[cfg(target_arch = "x86_64")] group! { impl_native!(f32_to_u32 f32 u32); impl_native!(f32_to_i32 f32 i32); impl_native!(f32_to_u64 f32 u64); impl_native!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_native!(f64_to_u32 f64 u32); impl_native!(f64_to_i32 f64 i32); impl_native!(f64_to_u64 f64 u64); impl_native!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_native!(u8_to_f32 u8 f32); impl_native!(i8_to_f32 i8 f32); impl_native!(u16_to_f32 u16 f32); impl_native!(i16_to_f32 i16 f32); impl_native!(u32_to_f32 u32 f32); impl_native!(i32_to_f32 i32 f32); impl_native!(u64_to_f32 u64 f32); impl_native!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_native!(u8_to_f64 u8 f64); impl_native!(i8_to_f64 i8 f64); impl_native!(u16_to_f64 u16 f64); impl_native!(i16_to_f64 i16 f64); impl_native!(u32_to_f64 u32 f64); impl_native!(i32_to_f64 i32 f64); impl_native!(u64_to_f64 u64 f64); impl_native!(i64_to_f64 i64 f64); impl_special!(u128_to_f64 u128 f64); impl_special!(i128_to_f64 i128 f64); } #[cfg(all(target_arch = "x86", target_feature = "sse2"))] group! { impl_native!(f32_to_u32 f32 u32); impl_native!(f32_to_i32 f32 i32); impl_native!(f32_to_u64 f32 u64); impl_native!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_native!(f64_to_u32 f64 u32); impl_native!(f64_to_i32 f64 i32); impl_native!(f64_to_u64 f64 u64); impl_native!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_native!(u8_to_f32 u8 f32); impl_native!(i8_to_f32 i8 f32); impl_native!(u16_to_f32 u16 f32); impl_native!(i16_to_f32 i16 f32); impl_native!(u32_to_f32 u32 f32); impl_native!(i32_to_f32 i32 f32); impl_special!(u64_to_f32 u64 f32); impl_native!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_native!(u8_to_f64 u8 f64); impl_native!(i8_to_f64 i8 f64); impl_native!(u16_to_f64 u16 f64); impl_native!(i16_to_f64 i16 f64); impl_native!(u32_to_f64 u32 f64); impl_native!(i32_to_f64 i32 f64); impl_special!(u64_to_f64 u64 f64); impl_native!(i64_to_f64 i64 f64); impl_special!(u128_to_f64 u128 f64); impl_special!(i128_to_f64 i128 f64); } #[cfg(all(target_arch = "x86", not(target_feature = "sse2")))] group! { impl_native!(f32_to_u32 f32 u32); impl_native!(f32_to_i32 f32 i32); impl_native!(f32_to_u64 f32 u64); impl_native!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_native!(f64_to_u32 f64 u32); impl_native!(f64_to_i32 f64 i32); impl_native!(f64_to_u64 f64 u64); impl_native!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_native!(u8_to_f32 u8 f32); impl_native!(i8_to_f32 i8 f32); impl_native!(u16_to_f32 u16 f32); impl_native!(i16_to_f32 i16 f32); impl_special!(u32_to_f32 u32 f32); impl_native!(i32_to_f32 i32 f32); impl_soft!(u64_to_f32 u64 f32); impl_soft!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_native!(u8_to_f64 u8 f64); impl_native!(i8_to_f64 i8 f64); impl_native!(u16_to_f64 u16 f64); impl_native!(i16_to_f64 i16 f64); impl_native!(u32_to_f64 u32 f64); impl_native!(i32_to_f64 i32 f64); impl_soft!(u64_to_f64 u64 f64); impl_native!(i64_to_f64 i64 f64); impl_soft!(u128_to_f64 u128 f64); impl_soft!(i128_to_f64 i128 f64); } #[cfg(target_feature = "vfp2")] group! { impl_native!(f32_to_u32 f32 u32); impl_native!(f32_to_i32 f32 i32); impl_soft!(f32_to_u64 f32 u64); impl_soft!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_native!(f64_to_u32 f64 u32); impl_native!(f64_to_i32 f64 i32); impl_soft!(f64_to_u64 f64 u64); impl_soft!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_native!(u8_to_f32 u8 f32); impl_native!(i8_to_f32 i8 f32); impl_native!(u16_to_f32 u16 f32); impl_native!(i16_to_f32 i16 f32); impl_native!(u32_to_f32 u32 f32); impl_native!(i32_to_f32 i32 f32); impl_soft!(u64_to_f32 u64 f32); impl_soft!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_native!(u8_to_f64 u8 f64); impl_native!(i8_to_f64 i8 f64); impl_native!(u16_to_f64 u16 f64); impl_native!(i16_to_f64 i16 f64); impl_native!(u32_to_f64 u32 f64); impl_native!(i32_to_f64 i32 f64); impl_soft!(u64_to_f64 u64 f64); impl_soft!(i64_to_f64 i64 f64); impl_soft!(u128_to_f64 u128 f64); impl_soft!(i128_to_f64 i128 f64); } #[cfg(not(any( target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86", target_feature = "vfp2", )))] group! { impl_soft!(f32_to_u32 f32 u32); impl_soft!(f32_to_i32 f32 i32); impl_soft!(f32_to_u64 f32 u64); impl_soft!(f32_to_i64 f32 i64); impl_soft!(f32_to_u128 f32 u128); impl_soft!(f32_to_i128 f32 i128); impl_soft!(f64_to_u32 f64 u32); impl_soft!(f64_to_i32 f64 i32); impl_soft!(f64_to_u64 f64 u64); impl_soft!(f64_to_i64 f64 i64); impl_soft!(f64_to_u128 f64 u128); impl_soft!(f64_to_i128 f64 i128); impl_soft!(u8_to_f32 u8 f32); impl_soft!(i8_to_f32 i8 f32); impl_soft!(u16_to_f32 u16 f32); impl_soft!(i16_to_f32 i16 f32); impl_soft!(u32_to_f32 u32 f32); impl_soft!(i32_to_f32 i32 f32); impl_soft!(u64_to_f32 u64 f32); impl_soft!(i64_to_f32 i64 f32); impl_soft!(u128_to_f32 u128 f32); impl_soft!(i128_to_f32 i128 f32); impl_soft!(u8_to_f64 u8 f64); impl_soft!(i8_to_f64 i8 f64); impl_soft!(u16_to_f64 u16 f64); impl_soft!(i16_to_f64 i16 f64); impl_soft!(u32_to_f64 u32 f64); impl_soft!(i32_to_f64 i32 f64); impl_soft!(u64_to_f64 u64 f64); impl_soft!(i64_to_f64 i64 f64); impl_soft!(u128_to_f64 u128 f64); impl_soft!(i128_to_f64 i128 f64); }
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/lib.rs
src/lib.rs
//! Simple resampling library in pure Rust. //! //! # Examples //! //! ``` //! use resize::Pixel::RGB8; //! use resize::Type::Lanczos3; //! use rgb::RGB8; //! use rgb::FromSlice; //! //! // Downscale by 2x. //! let (w1, h1) = (640, 480); //! let (w2, h2) = (320, 240); //! // Don't forget to fill `src` with image data (RGB8). //! let src = vec![0;w1*h1*3]; //! // Destination buffer. Must be mutable. //! let mut dst = vec![0;w2*h2*3]; //! // Create reusable instance. //! let mut resizer = resize::new(w1, h1, w2, h2, RGB8, Lanczos3)?; //! // Do resize without heap allocations. //! // Might be executed multiple times for different `src` or `dst`. //! resizer.resize(src.as_rgb(), dst.as_rgb_mut()); //! # Ok::<_, resize::Error>(()) //! ``` // Current implementation is based on: // * https://github.com/sekrit-twc/zimg/tree/master/src/zimg/resize // * https://github.com/PistonDevelopers/image/blob/master/src/imageops/sample.rs #![deny(missing_docs)] #![cfg_attr(all(feature = "no_std", not(feature = "std")), no_std)] extern crate alloc; use core::f32; use core::fmt; use core::num::NonZeroUsize; use alloc::boxed::Box; use alloc::collections::TryReserveError; use alloc::sync::Arc; use alloc::vec::Vec; #[cfg(all(feature = "no_std", not(feature = "std")))] use hashbrown::HashMap; #[cfg(not(all(feature = "no_std", not(feature = "std"))))] use std::collections::HashMap; #[cfg(feature = "rayon")] use rayon::prelude::*; /// See [Error] pub type Result<T, E = Error> = core::result::Result<T, E>; /// Pixel format from the [rgb] crate. pub mod px; pub use px::PixelFormat; #[cfg(all(feature = "no_std", not(feature = "std")))] mod no_std_float; #[cfg(all(feature = "no_std", not(feature = "std")))] #[allow(unused_imports)] use no_std_float::FloatExt; /// Resizing type to use. /// /// For a detailed explanation and comparison of the different filters, see /// [this article](https://www.imagemagick.org/Usage/filter/). pub enum Type { /// Point resizing/nearest neighbor. /// /// This is the fastest method, but also has the lowest quality. It will /// produce block/aliased results. Point, /// Triangle (bilinear) resizing. /// /// A fast method that produces smooth results. Triangle, /// Catmull-Rom (bicubic) resizing. /// /// This is the default cubic filter in many image editing programs. It /// produces sharp results for both upscaling and downscaling. Catrom, /// Resize using the (bicubic) Mitchell-Netravali filter. /// /// This filter is similar to [Type::Catrom], but produces slightly /// smoother results, which can eliminate over-sharpening artifacts when /// upscaling. Mitchell, /// B-spline (bicubic) resizing. /// /// This filter produces smoother results than [Type::Catrom] and /// [Type::Mitchell]. It can appear a little blurry, but not as blurry as /// [Type::Gaussian]. BSpline, /// Gaussian resizing. /// /// Uses a Gaussian function as a filter. This is a slow filter that produces /// very smooth results akin to a slight gaussian blur. Its main advantage /// is that it doesn't introduce ringing or aliasing artifacts. Gaussian, /// Resize using Sinc-windowed Sinc with radius of 3. /// /// A slow filter that produces sharp results, but can have ringing. /// Recommended for high-quality image resizing. Lanczos3, /// Resize with custom filter. Custom(Filter), } impl Type { fn as_filter_ref(&self) -> (DynCallback<'_>, f32) { match self { Type::Point => (&point_kernel as DynCallback, 0.0_f32), Type::Triangle => (&triangle_kernel as DynCallback, 1.0), Type::Catrom => ((&|x| cubic_bc(0.0, 0.5, x)) as DynCallback, 2.0), Type::Mitchell => ((&|x| cubic_bc(1.0/3.0, 1.0/3.0, x)) as DynCallback, 2.0), Type::BSpline => ((&|x| cubic_bc(1.0, 0.0, x)) as DynCallback, 2.0), Type::Gaussian => ((&|x| gaussian(x, 0.5)) as DynCallback, 3.0), Type::Lanczos3 => ((&|x| lanczos(3.0, x)) as DynCallback, 3.0), Type::Custom(ref f) => (&f.kernel as DynCallback, f.support), } } } /// Resampling filter. pub struct Filter { kernel: Box<dyn Fn(f32) -> f32>, support: f32, } impl Filter { /// Create a new filter. /// /// # Examples /// /// ``` /// use resize::Filter; /// fn kernel(x: f32) -> f32 { f32::max(1.0 - x.abs(), 0.0) } /// let filter = Filter::new(Box::new(kernel), 1.0); /// ``` #[must_use] #[inline(always)] pub fn new(kernel: Box<dyn Fn(f32) -> f32>, support: f32) -> Self { Self { kernel, support } } /// Helper to create Cubic filter with custom B and C parameters. #[doc(hidden)] #[deprecated(note = "use Type enum")] pub fn new_cubic(b: f32, c: f32) -> Self { Self::new(Box::new(move |x| cubic_bc(b, c, x)), 2.0) } /// Helper to create Lanczos filter with custom radius. #[doc(hidden)] #[deprecated(note = "use Type enum")] pub fn new_lanczos(radius: f32) -> Self { Self::new(Box::new(move |x| lanczos(radius, x)), radius) } /// Hermite filter. /// /// A cubic filter that produces results between [Type::Triangle] and /// [Type::Box]. pub fn hermite(radius: f32) -> Self { Self::new(Box::new(move |x| cubic_bc(0.0, 0.0, x)), radius) } /// Lagrange resizing. /// /// Similar to [Type::Lanczos3], but with less ringing. pub fn lagrange(radius: f32) -> Self { Self::new(Box::new(move |x| lagrange(radius, x)), radius) } /// Box filter. /// /// This is a simple average operation. It's the ideal filter when /// downscaling by an integer fraction (e.g. 1/2x, 1/3x, 1/4x). When used /// for upscaling, it will behave like [Type::Point]. pub fn box_filter(radius: f32) -> Self { Self::new(Box::new(box_kernel), radius) } } #[inline] fn point_kernel(_: f32) -> f32 { 1.0 } #[inline] fn box_kernel(x: f32) -> f32 { if x.abs() <= 0.5 { 1.0 } else { 0.0 } } #[inline] fn triangle_kernel(x: f32) -> f32 { f32::max(1.0 - x.abs(), 0.0) } // Taken from // https://github.com/PistonDevelopers/image/blob/2921cd7/src/imageops/sample.rs#L68 // TODO(Kagami): Could be optimized for known B and C, see e.g. // https://github.com/sekrit-twc/zimg/blob/1a606c0/src/zimg/resize/filter.cpp#L149 #[inline(always)] fn cubic_bc(b: f32, c: f32, x: f32) -> f32 { let a = x.abs(); let k = if a < 1.0 { (12.0 - 9.0 * b - 6.0 * c) * a.powi(3) + (-18.0 + 12.0 * b + 6.0 * c) * a.powi(2) + (6.0 - 2.0 * b) } else if a < 2.0 { (-b - 6.0 * c) * a.powi(3) + (6.0 * b + 30.0 * c) * a.powi(2) + (-12.0 * b - 48.0 * c) * a + (8.0 * b + 24.0 * c) } else { 0.0 }; k / 6.0 } // Taken from // https://github.com/image-rs/image/blob/81b3fe66fba04b8b60ba79b3641826df22fca67e/src/imageops/sample.rs#L181 /// The Gaussian Function. /// ```r``` is the standard deviation. #[inline(always)] fn gaussian(x: f32, r: f32) -> f32 { ((2.0 * f32::consts::PI).sqrt() * r).recip() * (-x.powi(2) / (2.0 * r.powi(2))).exp() } #[inline] fn sinc(x: f32) -> f32 { if x == 0.0 { 1.0 } else { let a = x * f32::consts::PI; a.sin() / a } } #[inline(always)] fn lanczos(taps: f32, x: f32) -> f32 { if x.abs() < taps { sinc(x) * sinc(x / taps) } else { 0.0 } } #[inline(always)] fn lagrange(x: f32, support: f32) -> f32 { let x = x.abs(); if x > support { return 0.0; } // Taken from // https://github.com/ImageMagick/ImageMagick/blob/e8b7974e8756fb278ec85d896065a1b96ed85af9/MagickCore/resize.c#L406 let order = (2.0 * support) as isize; let n = (support + x) as isize; let mut value = 1.0; for i in 0..order { let d = (n - i) as f32; if d != 0.0 { value *= (d - x) / d; } } value } /// Predefined constants for supported pixel formats. #[allow(non_snake_case)] #[allow(non_upper_case_globals)] pub mod Pixel { use crate::formats; use core::marker::PhantomData; /// Grayscale, 8-bit. #[cfg_attr(docsrs, doc(alias = "Grey"))] pub const Gray8: formats::Gray<u8, u8> = formats::Gray(PhantomData); /// Grayscale, 16-bit, native endian. pub const Gray16: formats::Gray<u16, u16> = formats::Gray(PhantomData); /// Grayscale, 32-bit float pub const GrayF32: formats::Gray<f32, f32> = formats::Gray(PhantomData); /// Grayscale, 64-bit float pub const GrayF64: formats::Gray<f64, f64> = formats::Gray(PhantomData); /// RGB, 8-bit per component. #[cfg_attr(docsrs, doc(alias = "RGB24"))] pub const RGB8: formats::Rgb<u8, u8> = formats::Rgb(PhantomData); /// RGB, 16-bit per component, native endian. #[cfg_attr(docsrs, doc(alias = "RGB48"))] pub const RGB16: formats::Rgb<u16, u16> = formats::Rgb(PhantomData); /// RGBA, 8-bit per component. Components are scaled independently. Use this if the input is already alpha-premultiplied. /// /// Preserves RGB values of fully-transparent pixels. Expect halos around edges of transparency if using regular, uncorrelated RGBA. See [RGBA8P]. #[cfg_attr(docsrs, doc(alias = "RGBA32"))] pub const RGBA8: formats::Rgba<u8, u8> = formats::Rgba(PhantomData); /// RGBA, 16-bit per component, native endian. Components are scaled independently. Use this if the input is already alpha-premultiplied. /// /// Preserves RGB values of fully-transparent pixels. Expect halos around edges of transparency if using regular, uncorrelated RGBA. See [RGBA16P]. #[cfg_attr(docsrs, doc(alias = "RGBA64"))] pub const RGBA16: formats::Rgba<u16, u16> = formats::Rgba(PhantomData); /// RGBA, 8-bit per component. RGB components will be converted to premultiplied during scaling, and then converted back to uncorrelated. /// /// Clears "dirty alpha". Use this for high-quality scaling of regular uncorrelated (not premultiplied) RGBA bitmaps. #[cfg_attr(docsrs, doc(alias = "premultiplied"))] #[cfg_attr(docsrs, doc(alias = "prem"))] pub const RGBA8P: formats::RgbaPremultiply<u8, u8> = formats::RgbaPremultiply(PhantomData); /// RGBA, 16-bit per component, native endian. RGB components will be converted to premultiplied during scaling, and then converted back to uncorrelated. /// /// Clears "dirty alpha". Use this for high-quality scaling of regular uncorrelated (not premultiplied) RGBA bitmaps. pub const RGBA16P: formats::RgbaPremultiply<u16, u16> = formats::RgbaPremultiply(PhantomData); /// RGB, 32-bit float per component. This is pretty efficient, since resizing uses f32 internally. pub const RGBF32: formats::Rgb<f32, f32> = formats::Rgb(PhantomData); /// RGB, 64-bit double per component. pub const RGBF64: formats::Rgb<f64, f64> = formats::Rgb(PhantomData); /// RGBA, 32-bit float per component. This is pretty efficient, since resizing uses f32 internally. /// /// Components are scaled independently (no premultiplication applied) pub const RGBAF32: formats::Rgba<f32, f32> = formats::Rgba(PhantomData); /// RGBA, 64-bit double per component. /// /// Components are scaled independently (no premultiplication applied) pub const RGBAF64: formats::Rgba<f64, f64> = formats::Rgba(PhantomData); } /// Implementation detail /// /// These structs implement `PixelFormat` trait that allows conversion to and from internal pixel representation. #[doc(hidden)] pub mod formats { use core::marker::PhantomData; /// RGB pixels #[derive(Debug, Copy, Clone)] pub struct Rgb<InputSubpixel, OutputSubpixel>(pub(crate) PhantomData<(InputSubpixel, OutputSubpixel)>); /// RGBA pixels, each channel is independent. Compatible with premultiplied input/output. #[derive(Debug, Copy, Clone)] pub struct Rgba<InputSubpixel, OutputSubpixel>(pub(crate) PhantomData<(InputSubpixel, OutputSubpixel)>); /// Apply premultiplication to RGBA pixels during scaling. Assumes **non**-premultiplied input/output. #[derive(Debug, Copy, Clone)] pub struct RgbaPremultiply<InputSubpixel, OutputSubpixel>(pub(crate) PhantomData<(InputSubpixel, OutputSubpixel)>); /// Grayscale pixels #[derive(Debug, Copy, Clone)] pub struct Gray<InputSubpixel, OutputSubpixel>(pub(crate) PhantomData<(InputSubpixel, OutputSubpixel)>); } /// Resampler with preallocated buffers and coeffecients for the given /// dimensions and filter type. #[derive(Debug)] pub struct Resizer<Format: PixelFormat> { scale: Scale, pix_fmt: Format, // Temporary/preallocated stuff. tmp: Vec<Format::Accumulator>, } #[derive(Debug)] struct Scale { /// Source dimensions. w1: NonZeroUsize, h1: NonZeroUsize, /// Vec's len == target dimensions coeffs_w: Vec<CoeffsLine>, coeffs_h: Vec<CoeffsLine>, } impl Scale { #[inline(always)] fn w2(&self) -> usize { self.coeffs_w.len() } #[inline(always)] fn h2(&self) -> usize { self.coeffs_h.len() } } #[derive(Debug, Clone)] struct CoeffsLine { start: usize, coeffs: Arc<[f32]>, } type DynCallback<'a> = &'a dyn Fn(f32) -> f32; impl Scale { pub fn new(source_width: usize, source_heigth: usize, dest_width: usize, dest_height: usize, filter_type: Type) -> Result<Self> { let source_width = NonZeroUsize::new(source_width).ok_or(Error::InvalidParameters)?; let source_heigth = NonZeroUsize::new(source_heigth).ok_or(Error::InvalidParameters)?; if dest_width == 0 || dest_height == 0 { return Err(Error::InvalidParameters); } let filter = filter_type.as_filter_ref(); // filters very often create repeating patterns, // so overall memory used by them can be reduced // which should save some cache space let mut recycled_coeffs = HashMap::new(); recycled_coeffs.try_reserve(dest_width.max(dest_height))?; let coeffs_w = Self::calc_coeffs(source_width, dest_width, filter, &mut recycled_coeffs)?; let coeffs_h = if source_heigth == source_width && dest_height == dest_width { coeffs_w.clone() } else { Self::calc_coeffs(source_heigth, dest_height, filter, &mut recycled_coeffs)? }; Ok(Self { w1: source_width, h1: source_heigth, coeffs_w, coeffs_h, }) } #[inline(never)] fn calc_coeffs(s1: NonZeroUsize, s2: usize, (kernel, support): (DynCallback<'_>, f32), recycled_coeffs: &mut HashMap<(usize, [u8; 4], [u8; 4]), Arc<[f32]>>) -> Result<Vec<CoeffsLine>> { let ratio = s1.get() as f64 / s2 as f64; // Scale the filter when downsampling. let filter_scale = ratio.max(1.); let filter_radius = (f64::from(support) * filter_scale).ceil(); let mut res = Vec::new(); res.try_reserve_exact(s2)?; for x2 in 0..s2 { let x1 = (x2 as f64 + 0.5) * ratio - 0.5; let start = (x1 - filter_radius).ceil() as isize; let start = start.min(s1.get() as isize - 1).max(0) as usize; let end = (x1 + filter_radius).floor() as isize; let end = (end.min(s1.get() as isize - 1).max(0) as usize).max(start); let sum: f64 = (start..=end).map(|i| f64::from((kernel)(((i as f64 - x1) / filter_scale) as f32))).sum(); let key = (end - start, (filter_scale as f32).to_ne_bytes(), (start as f32 - x1 as f32).to_ne_bytes()); let coeffs = if let Some(k) = recycled_coeffs.get(&key) { k.clone() } else { let tmp = (start..=end).map(|i| { let n = ((i as f64 - x1) / filter_scale) as f32; (f64::from((kernel)(n.min(support).max(-support))) / sum) as f32 }).collect::<Arc<[_]>>(); recycled_coeffs.try_reserve(1)?; recycled_coeffs.insert(key, tmp.clone()); tmp }; res.push(CoeffsLine { start, coeffs }); } Ok(res) } } impl<Format: PixelFormat> Resizer<Format> { /// Create a new resizer instance. #[inline] pub fn new(source_width: usize, source_heigth: usize, dest_width: usize, dest_height: usize, pixel_format: Format, filter_type: Type) -> Result<Self> { Ok(Self { scale: Scale::new(source_width, source_heigth, dest_width, dest_height, filter_type)?, tmp: Vec::new(), pix_fmt: pixel_format, }) } /// Stride is a length of the source row (>= W1) #[cfg(not(feature = "rayon"))] fn resample_both_axes(&mut self, src: &[Format::InputPixel], stride: NonZeroUsize, dst: &mut [Format::OutputPixel]) -> Result<()> { let w2 = self.scale.w2(); // eliminate panic in step_by if w2 == 0 { return Err(Error::InvalidParameters); } self.tmp.clear(); self.tmp.try_reserve_exact(w2 * self.scale.h1.get())?; // Outer loop resamples W2xH1 to W2xH2 let mut src_rows = src.chunks(stride.get()); for (dst, row) in dst.chunks_exact_mut(w2).zip(&self.scale.coeffs_h) { // Inner loop resamples W1xH1 to W2xH1, // but only as many rows as necessary to write a new line // to the output let end = w2 * (row.start + row.coeffs.len()); while self.tmp.len() < end { let row = src_rows.next().unwrap(); let pix_fmt = &self.pix_fmt; self.tmp.extend(self.scale.coeffs_w.iter().map(|col| { // it won't fail, but get avoids panic code bloat let in_px = row.get(col.start..col.start + col.coeffs.len()).unwrap_or_default(); let mut accum = Format::new(); for (coeff, in_px) in col.coeffs.iter().copied().zip(in_px.iter().copied()) { pix_fmt.add(&mut accum, in_px, coeff) } accum })); } let tmp_row_start = &self.tmp.get(w2 * row.start..).unwrap_or_default(); for (col, dst_px) in dst.iter_mut().enumerate() { let mut accum = Format::new(); for (coeff, other_row) in row.coeffs.iter().copied().zip(tmp_row_start.iter().copied().skip(col).step_by(w2)) { Format::add_acc(&mut accum, other_row, coeff); } *dst_px = self.pix_fmt.into_pixel(accum); } } Ok(()) } #[cfg(feature = "rayon")] fn resample_both_axes(&mut self, mut src: &[Format::InputPixel], stride: NonZeroUsize, dst: &mut [Format::OutputPixel]) -> Result<()> { let stride = stride.get(); let pix_fmt = &self.pix_fmt; let w2 = self.scale.w2(); let h2 = self.scale.h2(); let w1 = self.scale.w1.get(); let h1 = self.scale.h1.get(); // Ensure the destination buffer has adequate size for the resampling operation. if w2 == 0 || h2 == 0 || dst.len() < w2 * h2 || src.len() < (stride * h1) + w1 - stride { return Err(Error::InvalidParameters); } // ensure it doesn't have too many rows if src.len() > stride * h1 { src = &src[..stride * h1]; } // Prepare the temporary buffer for intermediate storage. self.tmp.clear(); let tmp_area = w2 * h1; self.tmp.try_reserve_exact(tmp_area)?; debug_assert_eq!(w2, self.scale.coeffs_w.len()); // in tiny images spawning of tasks takes longer than single-threaded resizing // constant/area is for small images. h1.max(w2) for wide images. h1/256 for tall images. let work_chunk = ((1<<14) / (w2 * h1.max(w2))).max(h1/256); // Horizontal Resampling // Process each row in parallel. Each pixel within a row is processed sequentially. src.par_chunks(stride).with_min_len(work_chunk).zip(self.tmp.spare_capacity_mut().par_chunks_exact_mut(self.scale.coeffs_w.len())).for_each(|(row, tmp)| { // For each pixel in the row, calculate the horizontal resampling and store the result. self.scale.coeffs_w.iter().zip(tmp).for_each(move |(col, tmp)| { // this get won't fail, but it generates less code than panicking [] let in_px = row.get(col.start..col.start + col.coeffs.len()).unwrap_or_default(); let mut accum = Format::new(); for (coeff, in_px) in col.coeffs.iter().copied().zip(in_px.iter().copied()) { pix_fmt.add(&mut accum, in_px, coeff); } // Write the accumulated value to the temporary buffer. tmp.write(accum); }); }); // already checked that src had right number lines for the loop to write all unsafe { self.tmp.set_len(tmp_area); } let tmp_slice = self.tmp.as_slice(); // Vertical Resampling // Process each row in parallel. Each pixel within a row is processed sequentially. dst.par_chunks_exact_mut(w2).with_min_len(((1<<14) / (w2 * h2.max(w2))).max(h2/256)).zip(self.scale.coeffs_h.par_iter()).for_each(move |(dst, row)| { // Determine the start of the current row in the temporary buffer. let tmp_row_start = &tmp_slice.get(w2 * row.start..).unwrap_or_default(); // For each pixel in the row, calculate the vertical resampling and store the result directly into the destination buffer. dst.iter_mut().enumerate().for_each(move |(x, dst)| { let mut accum = Format::new(); for (coeff, other_pixel) in row.coeffs.iter().copied().zip(tmp_row_start.iter().copied().skip(x).step_by(w2)) { Format::add_acc(&mut accum, other_pixel, coeff); } // Write the accumulated value to the destination buffer. *dst = pix_fmt.into_pixel(accum); }); }); Ok(()) } /// Resize `src` image data into `dst`. #[inline] pub(crate) fn resize_internal(&mut self, src: &[Format::InputPixel], src_stride: NonZeroUsize, dst: &mut [Format::OutputPixel]) -> Result<()> { if self.scale.w1.get() > src_stride.get() || src.len() < (src_stride.get() * self.scale.h1.get()) + self.scale.w1.get() - src_stride.get() || dst.len() != self.scale.w2() * self.scale.h2() { return Err(Error::InvalidParameters) } self.resample_both_axes(src, src_stride, dst) } } impl<Format: PixelFormat> Resizer<Format> { /// Resize `src` image data into `dst`. #[inline] pub fn resize(&mut self, src: &[Format::InputPixel], dst: &mut [Format::OutputPixel]) -> Result<()> { self.resize_internal(src, self.scale.w1, dst) } /// Resize `src` image data into `dst`, skipping `stride` pixels each row. #[inline] pub fn resize_stride(&mut self, src: &[Format::InputPixel], src_stride: usize, dst: &mut [Format::OutputPixel]) -> Result<()> { let src_stride = NonZeroUsize::new(src_stride).ok_or(Error::InvalidParameters)?; self.resize_internal(src, src_stride, dst) } } /// Create a new resizer instance. Alias for `Resizer::new`. #[inline(always)] pub fn new<Format: PixelFormat>(src_width: usize, src_height: usize, dest_width: usize, dest_height: usize, pixel_format: Format, filter_type: Type) -> Result<Resizer<Format>> { Resizer::new(src_width, src_height, dest_width, dest_height, pixel_format, filter_type) } /// Use `new().resize()` instead. /// /// Resize image data to the new dimension in a single step. /// /// **NOTE:** If you need to resize to the same dimension multiple times, /// consider creating an resizer instance since it's faster. #[deprecated(note="Use resize::new().resize()")] #[allow(deprecated)] pub fn resize<Format: PixelFormat>( src_width: usize, src_height: usize, dest_width: usize, dest_height: usize, pixel_format: Format, filter_type: Type, src: &[Format::InputPixel], dst: &mut [Format::OutputPixel], ) -> Result<()> { Resizer::<Format>::new(src_width, src_height, dest_width, dest_height, pixel_format, filter_type)?.resize(src, dst) } /// Resizing may run out of memory #[derive(Debug)] pub enum Error { /// Allocation failed OutOfMemory, /// e.g. width or height can't be 0 InvalidParameters, } #[cfg(feature = "std")] impl std::error::Error for Error {} impl From<TryReserveError> for Error { #[inline(always)] fn from(_: TryReserveError) -> Self { Self::OutOfMemory } } #[cfg(all(feature = "no_std", not(feature = "std")))] impl From<hashbrown::TryReserveError> for Error { #[inline(always)] fn from(_: hashbrown::TryReserveError) -> Self { Self::OutOfMemory } } impl fmt::Display for Error { #[cold] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(match self { Self::OutOfMemory => "out of memory", Self::InvalidParameters => "invalid parameters" }) } } #[cfg(all(test, feature = "std"))] mod tests { use super::*; #[test] fn oom() { let _ = new(2, 2, isize::max_value() as _, isize::max_value() as _, Pixel::Gray16, Type::Triangle); } #[test] fn niche() { assert_eq!(std::mem::size_of::<Resizer<formats::Gray<f32, f32>>>(), std::mem::size_of::<Option<Resizer<formats::Gray<f32, f32>>>>()); } #[test] fn zeros() { assert!(new(1, 1, 1, 0, Pixel::Gray16, Type::Triangle).is_err()); assert!(new(1, 1, 0, 1, Pixel::Gray8, Type::Catrom).is_err()); assert!(new(1, 0, 1, 1, Pixel::RGBAF32, Type::Lanczos3).is_err()); assert!(new(0, 1, 1, 1, Pixel::RGB8, Type::Mitchell).is_err()); } #[test] fn premultiply() { use px::RGBA; let mut r = new(2, 2, 3, 4, Pixel::RGBA8P, Type::Triangle).unwrap(); let mut dst = vec![RGBA::new(0u8,0,0,0u8); 12]; r.resize(&[ RGBA::new(255,127,3,255), RGBA::new(0,0,0,0), RGBA::new(255,255,255,0), RGBA::new(0,255,255,0), ], &mut dst).unwrap(); assert_eq!(&dst, &[ RGBA { r: 255, g: 127, b: 3, a: 255 }, RGBA { r: 255, g: 127, b: 3, a: 128 }, RGBA { r: 0, g: 0, b: 0, a: 0 }, RGBA { r: 255, g: 127, b: 3, a: 191 }, RGBA { r: 255, g: 127, b: 3, a: 96 }, RGBA { r: 0, g: 0, b: 0, a: 0 }, RGBA { r: 255, g: 127, b: 3, a: 64 }, RGBA { r: 255, g: 127, b: 3, a: 32 }, RGBA { r: 0, g: 0, b: 0, a: 0 }, RGBA { r: 0, g: 0, b: 0, a: 0 }, RGBA { r: 0, g: 0, b: 0, a: 0 }, RGBA { r: 0, g: 0, b: 0, a: 0 } ]); } #[test] fn premultiply_solid() { use px::RGBA; let mut r = new(2, 2, 3, 4, Pixel::RGBA8P, Type::Triangle).unwrap(); let mut dst = vec![RGBA::new(0u8,0,0,0u8); 12]; r.resize(&[ RGBA::new(255,255,255,255), RGBA::new(0,0,0,255), RGBA::new(0,0,0,255), RGBA::new(0,0,0,255), ], &mut dst).unwrap(); assert_eq!(&dst, &[ RGBA { r: 255, g: 255, b: 255, a: 255 }, RGBA { r: 128, g: 128, b: 128, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, RGBA { r: 191, g: 191, b: 191, a: 255 }, RGBA { r: 96, g: 96, b: 96, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, RGBA { r: 64, g: 64, b: 64, a: 255 }, RGBA { r: 32, g: 32, b: 32, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, RGBA { r: 0, g: 0, b: 0, a: 255 }, ]); } #[test] fn resize_stride() { use rgb::FromSlice; let mut r = new(2, 2, 3, 4, Pixel::Gray16, Type::Triangle).unwrap(); let mut dst = vec![0; 12]; r.resize_stride([ 65535,65535,1,2, 65535,65535,3,4, ].as_gray(), 4, dst.as_gray_mut()).unwrap(); assert_eq!(&dst, &[65535; 12]); } #[test] fn resize_float() { use rgb::FromSlice; let mut r = new(2, 2, 3, 4, Pixel::GrayF32, Type::Triangle).unwrap(); let mut dst = vec![0.; 12]; r.resize_stride([ 65535.,65535.,1.,2., 65535.,65535.,3.,4., ].as_gray(), 4, dst.as_gray_mut()).unwrap(); assert_eq!(&dst, &[65535.; 12]); } }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/no_std_float.rs
src/no_std_float.rs
/// Alternative basic float operations for no_std pub(crate) trait FloatExt { fn floor(self) -> Self; fn ceil(self) -> Self; fn sqrt(self) -> Self; fn round(self) -> Self; fn abs(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn sin(self) -> Self; fn exp(self) -> Self; fn powi(self, n: i32) -> Self; } impl FloatExt for f32 { #[inline] fn floor(self) -> Self { libm::floorf(self) } #[inline] fn ceil(self) -> Self { libm::ceilf(self) } #[inline] fn sqrt(self) -> Self { libm::sqrtf(self) } #[inline] fn round(self) -> Self { libm::roundf(self) } #[inline] fn abs(self) -> Self { libm::fabsf(self) } #[inline] fn trunc(self) -> Self { libm::truncf(self) } #[inline] fn fract(self) -> Self { self - self.trunc() } #[inline] fn sin(self) -> Self { libm::sinf(self) } #[inline] fn powi(self, n: i32) -> Self { libm::powf(self, n as _) } #[inline] fn exp(self) -> Self { libm::expf(self) } } impl FloatExt for f64 { #[inline] fn floor(self) -> Self { libm::floor(self) } #[inline] fn ceil(self) -> Self { libm::ceil(self) } #[inline] fn sqrt(self) -> Self { libm::sqrt(self) } #[inline] fn round(self) -> Self { libm::round(self) } #[inline] fn abs(self) -> Self { libm::fabs(self) } #[inline] fn trunc(self) -> Self { libm::trunc(self) } #[inline] fn fract(self) -> Self { self - self.trunc() } #[inline] fn sin(self) -> Self { libm::sin(self) } #[inline] fn powi(self, n: i32) -> Self { libm::pow(self, n as _) } #[inline] fn exp(self) -> Self { libm::exp(self) } }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/px.rs
src/px.rs
use crate::formats; pub use rgb::Gray; pub use rgb::Rgb as RGB; pub use rgb::Rgba as RGBA; /// Use [`Pixel`](crate::Pixel) presets to specify pixel format. /// /// The trait represents a temporary object that adds pixels together. pub trait PixelFormat: Send + Sync { /// Pixel type in the source image type InputPixel: Send + Sync + Copy; /// Pixel type in the destination image (usually the same as Input) type OutputPixel: Default + Send + Sync + Copy; /// Temporary struct for the pixel in floating-point type Accumulator: Send + Sync + Copy; /// Create new floating-point pixel fn new() -> Self::Accumulator; /// Add new pixel with a given weight (first axis) fn add(&self, acc: &mut Self::Accumulator, inp: Self::InputPixel, coeff: f32); /// Add bunch of accumulated pixels with a weight (second axis) fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32); /// Finalize, convert to output pixel format fn into_pixel(&self, acc: Self::Accumulator) -> Self::OutputPixel; } impl<F: ToFloat, T: ToFloat> PixelFormat for formats::Rgb<T, F> { type InputPixel = RGB<F>; type OutputPixel = RGB<T>; type Accumulator = RGB<f32>; #[inline(always)] fn new() -> Self::Accumulator { RGB::new(0., 0., 0.) } #[inline(always)] fn add(&self, acc: &mut Self::Accumulator, inp: RGB<F>, coeff: f32) { acc.r += inp.r.to_float() * coeff; acc.g += inp.g.to_float() * coeff; acc.b += inp.b.to_float() * coeff; } #[inline(always)] fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32) { acc.r += inp.r * coeff; acc.g += inp.g * coeff; acc.b += inp.b * coeff; } #[inline(always)] fn into_pixel(&self, acc: Self::Accumulator) -> RGB<T> { RGB { r: T::from_float(acc.r), g: T::from_float(acc.g), b: T::from_float(acc.b), } } } impl<F: ToFloat, T: ToFloat> PixelFormat for formats::Rgba<T, F> { type InputPixel = RGBA<F>; type OutputPixel = RGBA<T>; type Accumulator = RGBA<f32>; #[inline(always)] fn new() -> Self::Accumulator { RGBA::new(0., 0., 0., 0.) } #[inline(always)] fn add(&self, acc: &mut Self::Accumulator, inp: RGBA<F>, coeff: f32) { acc.r += inp.r.to_float() * coeff; acc.g += inp.g.to_float() * coeff; acc.b += inp.b.to_float() * coeff; acc.a += inp.a.to_float() * coeff; } #[inline(always)] fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32) { acc.r += inp.r * coeff; acc.g += inp.g * coeff; acc.b += inp.b * coeff; acc.a += inp.a * coeff; } #[inline(always)] fn into_pixel(&self, acc: Self::Accumulator) -> RGBA<T> { RGBA { r: T::from_float(acc.r), g: T::from_float(acc.g), b: T::from_float(acc.b), a: T::from_float(acc.a), } } } impl<F: ToFloat, T: ToFloat> PixelFormat for formats::RgbaPremultiply<T, F> { type InputPixel = RGBA<F>; type OutputPixel = RGBA<T>; type Accumulator = RGBA<f32>; #[inline(always)] fn new() -> Self::Accumulator { RGBA::new(0., 0., 0., 0.) } #[inline(always)] fn add(&self, acc: &mut Self::Accumulator, inp: RGBA<F>, coeff: f32) { let a_coeff = inp.a.to_float() * coeff; acc.r += inp.r.to_float() * a_coeff; acc.g += inp.g.to_float() * a_coeff; acc.b += inp.b.to_float() * a_coeff; acc.a += a_coeff; } #[inline(always)] fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32) { acc.r += inp.r * coeff; acc.g += inp.g * coeff; acc.b += inp.b * coeff; acc.a += inp.a * coeff; } #[inline(always)] fn into_pixel(&self, acc: Self::Accumulator) -> RGBA<T> { if acc.a > 0. { let inv = 1.0 / acc.a; RGBA { r: T::from_float(acc.r * inv), g: T::from_float(acc.g * inv), b: T::from_float(acc.b * inv), a: T::from_float(acc.a), } } else { let zero = T::from_float(0.); RGBA::new(zero, zero, zero, zero) } } } impl<F: ToFloat, T: ToFloat> PixelFormat for formats::Gray<F, T> { type InputPixel = Gray<F>; type OutputPixel = Gray<T>; type Accumulator = Gray<f32>; #[inline(always)] fn new() -> Self::Accumulator { Gray::new(0.) } #[inline(always)] fn add(&self, acc: &mut Self::Accumulator, inp: Gray<F>, coeff: f32) { *acc.value_mut() += inp.value().to_float() * coeff; } #[inline(always)] fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32) { *acc.value_mut() += inp.value() * coeff; } #[inline(always)] fn into_pixel(&self, acc: Self::Accumulator) -> Gray<T> { Gray::new(T::from_float(acc.value())) } } use self::f::ToFloat; mod f { /// Internal, please don't use pub trait ToFloat: Default + Send + Sync + Sized + Copy + 'static { fn to_float(self) -> f32; fn from_float(f: f32) -> Self; } impl ToFloat for u8 { #[inline(always)] fn to_float(self) -> f32 { f32::from(self) } #[inline(always)] fn from_float(f: f32) -> Self { (f + 0.5) as u8 } } impl ToFloat for u16 { #[inline(always)] fn to_float(self) -> f32 { f32::from(self) } #[inline(always)] fn from_float(f: f32) -> Self { (f + 0.5) as u16 } } impl ToFloat for f32 { #[inline(always)] fn to_float(self) -> f32 { self } #[inline(always)] fn from_float(f: f32) -> Self { f } } impl ToFloat for f64 { #[inline(always)] fn to_float(self) -> f32 { self as f32 } #[inline(always)] fn from_float(f: f32) -> Self { f64::from(f) } } }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/tests/qa.rs
tests/qa.rs
use resize::Pixel::*; use resize::Type::*; use std::fs; use std::path::Path; fn load_png(mut data: &[u8]) -> Result<(usize, usize, Vec<u8>), png::DecodingError> { let decoder = png::Decoder::new(&mut data); let mut reader = decoder.read_info()?; let info = reader.info(); let w = info.width as usize; let h = info.height as usize; let mut src = vec![0; reader.output_buffer_size()]; reader.next_frame(&mut src)?; Ok((w, h, src)) } fn write_png(path: &Path, w2: usize, h2: usize, pixels: &[u8]) { let outfh = fs::File::create(path).unwrap(); let encoder = png::Encoder::new(outfh, w2 as u32, h2 as u32); encoder.write_header().unwrap().write_image_data(pixels).unwrap(); } fn img_diff(a: &[u8], b: &[u8]) -> f64 { assert_eq!(a.len(), b.len()); let sum = a.iter().copied().zip(b.iter().copied()).map(|(a,b)| { (i32::from(a) - i32::from(b)).pow(2) as u32 }).sum::<u32>(); f64::from(sum) / a.len() as f64 } fn assert_equals(img: &[u8], w2: usize, h2: usize, expected_filename: &str) { assert_eq!(img.len(), w2 * h2); assert!(w2 > 0 && h2 > 0); let (_, _, expected) = load_png(&fs::read(expected_filename).expect(expected_filename)).expect(expected_filename); let diff = img_diff(img, &expected); if diff > 0.0004 { let bad_file = Path::new(expected_filename).with_extension("failed-test.png"); write_png(&bad_file, w2, h2, img); panic!("Test failed: {} differs by {}; see {} ", expected_filename, diff, bad_file.display()); } } #[test] fn test_filter_init() { let _ = resize::new(3, 3, 25, 25, RGBF64, Point); let _ = resize::new(10, 10, 5, 5, RGBF64, Point); let _ = resize::new(3, 3, 25, 25, RGBF32, Triangle); let _ = resize::new(10, 10, 5, 5, RGBF32, Triangle); let _ = resize::new(3, 3, 25, 25, RGBAF64, Catrom); let _ = resize::new(10, 10, 5, 5, RGBAF64, Catrom); let _ = resize::new(3, 3, 25, 25, RGBAF32, Mitchell); let _ = resize::new(10, 10, 5, 5, RGBAF32, Mitchell); let _ = resize::new(3, 4, 25, 99, GrayF64, Lanczos3); let _ = resize::new(99, 70, 5, 1, GrayF64, Lanczos3); } fn test_width(w2: usize) { use rgb::FromSlice; let tiger = &include_bytes!("../examples/tiger.png")[..]; let (w1, h1, src) = load_png(tiger).unwrap(); let mut res1 = vec![]; let mut res2 = vec![]; let mut res3 = vec![0; 80*120]; for h2 in [1, 2, 9, 99, 999, 1555].iter().copied() { res1.clear(); res1.resize(w2 * h2, 0); resize::new(w1, h1, w2, h2, Gray8, Lanczos3).unwrap().resize(src.as_gray(), res1.as_gray_mut()).unwrap(); assert_equals(&res1, w2, h2, &format!("tests/t{w2}x{h2}.png")); res2.clear(); res2.resize(100 * 100, 255); resize::new(w2, h2, 100, 100, Gray8, Triangle).unwrap().resize(res1.as_gray(), res2.as_gray_mut()).unwrap(); assert_equals(&res2, 100, 100, &format!("tests/t{w2}x{h2}-100.png")); resize::new(100, 100, 80, 120, Gray8, Point).unwrap().resize(res2.as_gray(), res3.as_gray_mut()).unwrap(); assert_equals(&res3, 80, 120, &format!("tests/t{w2}x{h2}-point.png")); } } #[test] fn test_w2000() { test_width(2000); } #[test] fn test_w1000() { test_width(1000); } #[test] fn test_w100() { test_width(100); } #[test] fn test_w10() { test_width(10); } #[test] fn test_w2() { test_width(2); } #[test] fn test_w1() { test_width(1); } #[test] fn can_name_type() { let _: resize::Resizer<resize::formats::Gray<u8, u8>> = resize::new(10, 10, 100, 100, Gray8, Triangle).unwrap(); }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/benches/bench.rs
benches/bench.rs
#![feature(test)] extern crate test; use rgb::FromSlice; use test::Bencher; use resize::Pixel::{Gray16, Gray8, RGB8, RGBA16, RGBA16P, RGBA8}; use resize::Type::Catrom; use resize::Type::Lanczos3; use resize::Type::Point; use resize::Type::Triangle; use std::fs::File; use std::path::PathBuf; fn get_image() -> (u32, u32, Vec<u8>) { let root: PathBuf = env!("CARGO_MANIFEST_DIR").into(); let decoder = png::Decoder::new(File::open(root.join("examples/tiger.png")).unwrap()); let mut reader = decoder.read_info().unwrap(); let (width, height) = reader.info().size(); let mut src = vec![110; reader.output_buffer_size()]; reader.next_frame(&mut src).unwrap(); (width, height, src) } fn get_rolled() -> (u32, u32, Vec<u8>) { let root: PathBuf = env!("CARGO_MANIFEST_DIR").into(); let decoder = png::Decoder::new(File::open(root.join("examples/roll.png")).unwrap()); let mut reader = decoder.read_info().unwrap(); let (width, height) = reader.info().size(); let mut src = vec![99; reader.output_buffer_size()]; reader.next_frame(&mut src).unwrap(); (width, height, src) } #[bench] fn precomputed_large(b: &mut Bencher) { let (width, height, src) = get_image(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (1600, 1200); let mut dst = vec![120; w2 * h2]; let mut r = resize::new(w1, h1, w2, h2, Gray8, Triangle).unwrap(); b.iter(|| r.resize(src.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] fn multi_threaded(b: &mut Bencher) { let (w1, h1) = (1280, 768); let src1 = &vec![99; w1 * h1 * 3]; b.iter(|| { std::thread::scope(|s| { let s = &s; let handles: Vec<_> = (0..16).map(|n| { std::thread::Builder::new().spawn_scoped(s, move || { let (w2, h2) = (640-n*17, 512-n*17); let mut dst = vec![0; w2 * h2 * 3]; let mut r = resize::new(w1, h1, w2, h2, RGB8, Catrom).unwrap(); r.resize(src1.as_rgb(), dst.as_rgb_mut()).unwrap(); dst }).unwrap() }).collect(); handles.into_iter().map(|h| h.join().unwrap()).collect::<Vec<_>>() }) }); } #[bench] fn tiny_rgba(b: &mut Bencher) { let (w1, h1) = (60, 60); let src1 = vec![99; w1 * h1 * 4]; let (w2, h2) = (16, 12); let mut dst = vec![0; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA8, Lanczos3).unwrap(); b.iter(|| r.resize(src1.as_rgba(), dst.as_rgba_mut()).unwrap()); } #[bench] fn medium_rgb(b: &mut Bencher) { let (w1, h1) = (1280, 768); let src1 = vec![99; w1 * h1 * 3]; let (w2, h2) = (640, 512); let mut dst = vec![0; w2 * h2 * 3]; let mut r = resize::new(w1, h1, w2, h2, RGB8, Catrom).unwrap(); b.iter(|| r.resize(src1.as_rgb(), dst.as_rgb_mut()).unwrap()); } #[bench] fn hd_rgb(b: &mut Bencher) { let (w1, h1) = (4096, 2304); let src1 = vec![33; w1 * h1 * 3]; let (w2, h2) = (1920, 1080); let mut dst = vec![0; w2 * h2 * 3]; let mut r = resize::new(w1, h1, w2, h2, RGB8, Catrom).unwrap(); b.iter(|| r.resize(src1.as_rgb(), dst.as_rgb_mut()).unwrap()); } #[bench] fn down_to_tiny(b: &mut Bencher) { let (width, height, src0) = get_image(); let (w0, h0) = (width as usize, height as usize); let (w1, h1) = (3200, 2400); let mut src1 = vec![99; w1 * h1]; resize::new(w0, h0, w1, h1, Gray8, Triangle).unwrap().resize(src0.as_gray(), src1.as_gray_mut()).unwrap(); let (w2, h2) = (16, 12); let mut dst = vec![0; w2 * h2]; let mut r = resize::new(w1, h1, w2, h2, Gray8, Lanczos3).unwrap(); b.iter(|| r.resize(src1.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] fn huge_stretch(b: &mut Bencher) { let (width, height, src0) = get_image(); let (w0, h0) = (width as usize, height as usize); let (w1, h1) = (12, 12); let mut src1 = vec![99; w1 * h1]; resize::new(w0, h0, w1, h1, Gray8, Lanczos3).unwrap().resize(src0.as_gray(), src1.as_gray_mut()).unwrap(); let (w2, h2) = (1200, 1200); let mut dst = vec![0; w2 * h2]; let mut r = resize::new(w1, h1, w2, h2, Gray8, Triangle).unwrap(); b.iter(|| r.resize(src1.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] fn downsample_rgba(b: &mut Bencher) { let (width, height, src0) = get_rolled(); let (w0, h0) = (width as usize, height as usize); let (w1, h1) = (5000, 5000); let mut src1 = vec![99; w1 * h1 * 4]; resize::new(w0, h0, w1, h1, RGBA8, Lanczos3) .unwrap() .resize(src0.as_rgba(), src1.as_rgba_mut()) .unwrap(); let (w2, h2) = (720, 480); let mut dst = vec![0; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA8, Lanczos3).unwrap(); b.iter(|| r.resize(src1.as_rgba(), dst.as_rgba_mut()).unwrap()); } #[bench] fn downsample_wide_rgba(b: &mut Bencher) { let (width, height, src0) = get_rolled(); let (w0, h0) = (width as usize, height as usize); let (w1, h1) = (10000, 10); let mut src1 = vec![99; w1 * h1 * 4]; resize::new(w0, h0, w1, h1, RGBA8, Lanczos3) .unwrap() .resize(src0.as_rgba(), src1.as_rgba_mut()) .unwrap(); let (w2, h2) = (720, 480); let mut dst = vec![0; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA8, Lanczos3).unwrap(); b.iter(|| r.resize(src1.as_rgba(), dst.as_rgba_mut()).unwrap()); } #[bench] fn downsample_tall_rgba(b: &mut Bencher) { let (width, height, src0) = get_rolled(); let (w0, h0) = (width as usize, height as usize); let (w1, h1) = (10, 10000); let mut src1 = vec![99; w1 * h1 * 4]; resize::new(w0, h0, w1, h1, RGBA8, Lanczos3) .unwrap() .resize(src0.as_rgba(), src1.as_rgba_mut()) .unwrap(); let (w2, h2) = (720, 480); let mut dst = vec![0; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA8, Lanczos3).unwrap(); b.iter(|| r.resize(src1.as_rgba(), dst.as_rgba_mut()).unwrap()); } #[bench] fn precomputed_small(b: &mut Bencher) { let (width, height, src) = get_image(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100, 100); let mut dst = vec![240; w2 * h2]; let mut r = resize::new(w1, h1, w2, h2, Gray8, Triangle).unwrap(); b.iter(|| r.resize(src.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] fn a_small_rgb(b: &mut Bencher) { let (width, height, src) = get_image(); let src: Vec<_> = src.into_iter().map(|c| rgb::RGB::new(c, c, c)).collect(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100, 100); let mut dst = vec![240; w2 * h2 * 3]; let mut r = resize::new(w1, h1, w2, h2, RGB8, Triangle).unwrap(); b.iter(|| r.resize(&src, dst.as_rgb_mut()).unwrap()); } #[bench] fn a_small_rgba16(b: &mut Bencher) { let (width, height, src) = get_image(); let src: Vec<_> = src.into_iter().map(|c| { let w = (u16::from(c) << 8) | u16::from(c); rgb::RGBA::new(w,w,w,65535) }).collect(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100, 100); let mut dst = vec![0u16; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA16, Triangle).unwrap(); b.iter(|| r.resize(&src, dst.as_rgba_mut()).unwrap()); } #[bench] fn a_small_rgba16_premultiplied(b: &mut Bencher) { let (width, height, src) = get_image(); let src: Vec<_> = src.into_iter().map(|c| { let w = (u16::from(c) << 8) | u16::from(c); rgb::RGBA::new(w,w,w,65535) }).collect(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100, 100); let mut dst = vec![0u16; w2 * h2 * 4]; let mut r = resize::new(w1, h1, w2, h2, RGBA16P, Triangle).unwrap(); b.iter(|| r.resize(&src, dst.as_rgba_mut()).unwrap()); } #[bench] fn precomputed_small_16bit(b: &mut Bencher) { let (width, height, src) = get_image(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100,100); let mut dst = vec![33; w2*h2]; let src: Vec<_> = src.into_iter().map(|px|{ let px = u16::from(px); (px << 8) | px }).collect(); let mut r = resize::new(w1, h1, w2, h2, Gray16, Triangle).unwrap(); b.iter(|| r.resize(src.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] #[allow(deprecated)] fn recomputed_small(b: &mut Bencher) { let (width, height, src) = get_image(); let (w1, h1) = (width as usize, height as usize); let (w2, h2) = (100, 100); let mut dst = vec![0; w2 * h2]; b.iter(|| resize::resize(w1, h1, w2, h2, Gray8, Triangle, src.as_gray(), dst.as_gray_mut()).unwrap()); } #[bench] #[allow(deprecated)] fn init_lanczos(b: &mut Bencher) { b.iter(|| resize::new(test::black_box(100), 200, test::black_box(300), 400, RGB8, Lanczos3).unwrap()); } #[bench] #[allow(deprecated)] fn init_point(b: &mut Bencher) { b.iter(|| resize::new(test::black_box(100), 200, test::black_box(300), 400, RGB8, Point).unwrap()); }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/examples/resize.rs
examples/resize.rs
use png::BitDepth; use png::ColorType; use resize::Pixel; use resize::Type::Triangle; use rgb::FromSlice; use std::env; use std::fs::File; fn main() { let args: Vec<_> = env::args().collect(); if args.len() != 4 { return println!("Usage: {} in.png WxH out.png", args[0]); } let decoder = png::Decoder::new(File::open(&args[1]).unwrap()); let mut reader = decoder.read_info().unwrap(); let info = reader.info(); let color_type = info.color_type; let bit_depth = info.bit_depth; let (w1, h1) = (info.width as usize, info.height as usize); let mut src = vec![0; reader.output_buffer_size()]; reader.next_frame(&mut src).unwrap(); let dst_dims: Vec<_> = args[2].split('x').map(|s| s.parse().unwrap()).collect(); let (w2, h2) = (dst_dims[0], dst_dims[1]); let mut dst = vec![0u8; w2 * h2 * color_type.samples()]; assert_eq!(BitDepth::Eight, bit_depth); match color_type { ColorType::Grayscale => resize::new(w1, h1, w2, h2, Pixel::Gray8, Triangle).unwrap().resize(src.as_gray(), dst.as_gray_mut()).unwrap(), ColorType::Rgb => resize::new(w1, h1, w2, h2, Pixel::RGB8, Triangle).unwrap().resize(src.as_rgb(), dst.as_rgb_mut()).unwrap(), ColorType::Indexed => unimplemented!(), ColorType::GrayscaleAlpha => unimplemented!(), ColorType::Rgba => resize::new(w1, h1, w2, h2, Pixel::RGBA8, Triangle).unwrap().resize(src.as_rgba(), dst.as_rgba_mut()).unwrap(), }; let outfh = File::create(&args[3]).unwrap(); let mut encoder = png::Encoder::new(outfh, w2 as u32, h2 as u32); encoder.set_color(color_type); encoder.set_depth(bit_depth); encoder.write_header().unwrap().write_image_data(&dst).unwrap(); }
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/aws.rs
src/aws.rs
use rusoto_core::{ChainProvider, ProfileProvider}; pub fn credentials_provider(path: Option<&str>, profile: Option<&str>) -> ChainProvider { let mut profile_provider = ProfileProvider::new().expect( "Failed to create AWS credentials provider." ); if let Some(path) = path { profile_provider.set_file_path(path); } if let Some(profile) = profile { profile_provider.set_profile(profile); } ChainProvider::with_profile_provider(profile_provider) }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/process.rs
src/process.rs
use std::ffi::OsStr; use std::fmt::Display; use std::process::Command; use error::{KawsError, KawsResult}; pub fn execute_child_process<S: AsRef<OsStr> + Display>(program: S, args: &[S]) -> KawsResult { let mut command = Command::new(&program); command.args(args); let output = command.output()?; if !output.status.success() { return Err( KawsError::with_std_streams( format!("Execution of `{:?}` failed.", command), String::from_utf8_lossy(&output.stdout).to_string(), String::from_utf8_lossy(&output.stderr).to_string(), ) ); } Ok(None) }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/encryption.rs
src/encryption.rs
use std::fs::{File, remove_file}; use std::io::{ErrorKind, Read, Write}; use hyper::Client as HyperClient; use rusoto_core::{ ChainProvider, DispatchSignedRequest, ProvideAwsCredentials, Region, default_tls_client, }; use rusoto_kms::{ DecryptError, DecryptRequest, DecryptResponse, EncryptError, EncryptRequest, EncryptResponse, Kms, KmsClient, }; use rustc_serialize::base64::{FromBase64, STANDARD, ToBase64}; use error::{KawsError, KawsResult}; pub struct Encryptor<'a, P, D> where P: ProvideAwsCredentials, D: DispatchSignedRequest { client: KmsClient<P, D>, decrypted_files: Vec<String>, kms_master_key_id: Option<&'a str>, } impl<'a> Encryptor<'a, ChainProvider, HyperClient> { pub fn new( provider: ChainProvider, region: Region, kms_master_key_id: Option<&'a str>, ) -> Encryptor<'a, ChainProvider, HyperClient> { Encryptor { client: KmsClient::new( default_tls_client().expect("failed to create HTTP client with TLS"), provider, region, ), decrypted_files: vec![], kms_master_key_id: kms_master_key_id, } } pub fn decrypt_file(&mut self, source: &str) -> Result<Vec<u8>, KawsError> { let mut src = File::open(source)?; let mut encoded_data = String::new(); src.read_to_string(&mut encoded_data)?; let encrypted_data = encoded_data.from_base64()?; let decrypted_data = self.decrypt(encrypted_data)?; match decrypted_data.plaintext { Some(plaintext) => return Ok(plaintext), None => return Err(KawsError::new("No plaintext was returned from KMS".to_owned())), } } pub fn encrypt_and_write_file(&mut self, data: &[u8], file_path: &str) -> KawsResult { let encrypted_data = self.encrypt(data.to_owned())?; let mut file = File::create(file_path)?; match encrypted_data.ciphertext_blob { Some(ref ciphertext_blob) => { let encoded_data = ciphertext_blob.to_base64(STANDARD); file.write_all(encoded_data.as_bytes())?; } None => return Err(KawsError::new("No ciphertext was returned from KMS".to_owned())), } Ok(None) } // Private fn decrypt<'b>(&mut self, encrypted_data: Vec<u8>) -> Result<DecryptResponse, DecryptError> { let request = DecryptRequest { encryption_context: None, grant_tokens: None, ciphertext_blob: encrypted_data, }; self.client.decrypt(&request) } fn encrypt<'b>(&mut self, decrypted_data: Vec<u8>) -> Result<EncryptResponse, EncryptError> { let request = EncryptRequest { plaintext: decrypted_data, encryption_context: None, key_id: self.kms_master_key_id.expect("KMS key must be supplied to encrypt").to_owned(), grant_tokens: None, }; self.client.encrypt(&request) } } impl<'a, P, D> Drop for Encryptor<'a, P, D> where P: ProvideAwsCredentials, D: DispatchSignedRequest { fn drop(&mut self) { let mut failures = vec![]; for file in self.decrypted_files.iter() { log_wrap!(&format!("Removing unencrypted file {:?}", file), { if let Err(error) = remove_file(file) { match error.kind() { ErrorKind::NotFound => {}, _ => failures.push(error), } } }); } if !failures.is_empty() { panic!( "Failed to remove one or more encrypted files! You should remove these files \ manually if they are present: {:?}", failures, ); } } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/cli.rs
src/cli.rs
use std::cmp::Ordering; use bitstring::BitString; use cidr::Ipv4Cidr; use clap::{App, AppSettings, Arg, SubCommand}; pub fn app<'a, 'b>() -> App<'a, 'b> { App::new("kaws") .version(env!("CARGO_PKG_VERSION")) .about("Deploys Kubernetes clusters using AWS, CoreOS, and Terraform") .after_help("\nStart by creating a new repository with the `init` command.") .setting(AppSettings::GlobalVersion) .setting(AppSettings::SubcommandRequiredElseHelp) .subcommand(admin()) .subcommand(cluster()) .subcommand(init()) } fn admin<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("admin") .about("Commands for managing cluster administrators") .setting(AppSettings::SubcommandRequiredElseHelp) .subcommand(admin_create()) .subcommand(admin_install()) .subcommand(admin_sign()) } fn admin_create<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("create") .about("Generates a private key and certificate signing request for a new administrator") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster the new administrator should be able to access") ) .arg( Arg::with_name("name") .index(2) .required(true) .help("The new administrator's name") ) .arg( Arg::with_name("group") .short("g") .long("group") .takes_value(true) .multiple(true) .number_of_values(1) .help("A Kubernetes groups this user belongs to; this option can be specified more than once") ) .after_help( "\nCreates the following files:\n\n\ * clusters/CLUSTER/NAME-key.pem: The admin's unencrypted private key\n\ * clusters/CLUSTER/NAME-csr.pem: The admin's certificate signing request\n\n\ Generated files are only valid for the specified cluster. The private key should not be checked into Git." ) } fn admin_install<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("install") .about("Configures kubectl for a new cluster and administrator") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to configure") ) .arg( Arg::with_name("name") .index(2) .required(true) .help("The name of the administrator whose credentials are being installed") ) .after_help( "\nThe following files are expected by this command:\n\n\ * clusters/CLUSTER/k8s-ca.pem: The k8s CA certificate\n\ * clusters/CLUSTER/NAME.pem: The admin's client certificate\n\ * clusters/CLUSTER/NAME-key.pem: The admin's unencrypted private key" ) } fn admin_sign<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("sign") .about("Signs an administrator's certificate signing request, creating a new client certificate") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The name of the cluster the certificate will be valid for") ) .arg( Arg::with_name("name") .index(2) .required(true) .help("The new administrator's name") ) .after_help( "\nThe following files are expected by this command:\n\n\ * clusters/CLUSTER/k8s-ca.pem: The CA certificate\n\ * clusters/CLUSTER/k8s-ca-key-encrypted.base64: The KMS-encrypted CA private key\n\ * clusters/CLUSTER/NAME-csr.pem: The requesting administrator's CSR" ) } fn cluster<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("cluster") .about("Commands for managing a cluster's infrastructure") .setting(AppSettings::SubcommandRequiredElseHelp) .subcommand(cluster_apply()) .subcommand(cluster_destroy()) .subcommand(cluster_generate_pki()) .subcommand(cluster_init()) .subcommand(cluster_output()) .subcommand(cluster_plan()) .subcommand(cluster_refresh()) } fn cluster_apply<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("apply") .about("Applies the Terraform plan to the target cluster") .setting(AppSettings::TrailingVarArg) .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster whose plan should be applied") ) .arg( Arg::with_name("aws-credentials-path") .long("aws-credentials-path") .takes_value(true) .help("Path to the AWS credentials file, defaults to ~/.aws/credentials") ) .arg( Arg::with_name("aws-credentials-profile") .long("aws-credentials-profile") .takes_value(true) .help("Name of the AWS credentials profile to use, defaults to \"default\"") ) .arg( Arg::with_name("terraform-args") .index(2) .multiple(true) .hidden(true) .help("Additional arguments to be passed on to `terraform apply`") ) .after_help("\nAny arguments following a literal -- will be passed directly as options to `terraform apply`.") } fn cluster_destroy<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("destroy") .about("Destroys resources defined by the Terraform plan for the target cluster") .setting(AppSettings::TrailingVarArg) .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to destroy") ) .arg( Arg::with_name("aws-credentials-path") .long("aws-credentials-path") .takes_value(true) .help("Path to the AWS credentials file, defaults to ~/.aws/credentials") ) .arg( Arg::with_name("aws-credentials-profile") .long("aws-credentials-profile") .takes_value(true) .help("Name of the AWS credentials profile to use, defaults to \"default\"") ) .arg( Arg::with_name("terraform-args") .index(2) .multiple(true) .hidden(true) .help("Additional arguments to be passed on to `terraform destroy`") ) .after_help("\nAny arguments following a literal -- will be passed directly as options to `terraform destroy`.") } fn cluster_init<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("init") .about("Initializes all the configuration files for a new cluster") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The name of the cluster to create, e.g. \"production\"") ) .arg( Arg::with_name("aws-account-id") .short("A") .long("aws-account-id") .takes_value(true) .required(true) .help("The numeric ID of the AWS account, e.g. \"123456789012\"") ) .arg( Arg::with_name("ami") .short("a") .long("ami") .takes_value(true) .required(true) .help("EC2 AMI ID to use for all CoreOS instances, e.g. \"ami-1234\"") ) .arg( Arg::with_name("availability-zone") .long("availability-zone") .takes_value(true) .required(true) .help("Availability Zone for etcd instances and EBS volumes, e.g. \"us-east-1a\"") ) .arg( Arg::with_name("cidr") .short("C") .long("cidr") .takes_value(true) .required(true) .help("IPv4 network range of the subnet where Kubernetes nodes will run, e.g. \"10.0.2.0/24\"") .validator(|cidr| { let cidr: Ipv4Cidr = match cidr.parse() { Ok(cidr) => cidr, Err(_) => return Err("Invalid CIDR provided.".to_string()), }; let vpc_cidr: Ipv4Cidr = "10.0.0.0/16".parse().unwrap(); let elb_cidr: Ipv4Cidr = "10.0.0.0/24".parse().unwrap(); let etcd_cidr: Ipv4Cidr = "10.0.1.0/24".parse().unwrap(); match cidr.subset_cmp(&vpc_cidr) { Some(Ordering::Less) => {} _ => return Err("Provided CIDR must be a subset of 10.0.0.0/16.".to_string()), } match cidr.subset_cmp(&elb_cidr) { Some(_) => return Err("Provided CIDR cannot overlap with 10.0.0.0/24, which is used for ELBs.".to_string()), None => {} } match cidr.subset_cmp(&etcd_cidr) { Some(_) => return Err("Provided CIDR cannot overlap with 10.0.1.0/24, which is used for etcd.".to_string()), None => {} } Ok(()) }) ) .arg( Arg::with_name("domain") .short("d") .long("domain") .takes_value(true) .required(true) .help("The base domain name for the cluster, e.g. \"example.com\"") ) .arg( Arg::with_name("masters-max-size") .long("masters-max-size") .takes_value(true) .required(true) .help( "The maximum number of EC2 instances the Kubernetes masters may autoscale to" ) ) .arg( Arg::with_name("masters-min-size") .long("masters-min-size") .takes_value(true) .required(true) .help( "The minimum number of EC2 instances the Kubernetes masters may autoscale to" ) ) .arg( Arg::with_name("nodes-max-size") .long("nodes-max-size") .takes_value(true) .required(true) .help( "The maximum number of EC2 instances the Kubernetes nodes may autoscale to" ) ) .arg( Arg::with_name("nodes-min-size") .long("nodes-min-size") .takes_value(true) .required(true) .help( "The minimum number of EC2 instances the Kubernetes nodes may autoscale to" ) ) .arg( Arg::with_name("region") .short("r") .long("region") .takes_value(true) .required(true) .help("AWS Region to create the resources in, e.g. \"us-east-1\"") ) .arg( Arg::with_name("iam-user") .short("i") .long("iam-user") .takes_value(true) .multiple(true) .required(true) .number_of_values(1) .help("An IAM user name who will have access to cluster PKI secrets, e.g. \"alice\"; this option can be specified more than once") ) .arg( Arg::with_name("size") .short("s") .long("instance-size") .takes_value(true) .required(true) .help("EC2 instance size to use for all instances, e.g. \"m3.medium\"") ) .arg( Arg::with_name("ssh-key") .short("K") .long("ssh-key") .takes_value(true) .multiple(true) .required(true) .number_of_values(1) .help("SSH public key to add to ~/.ssh/authorized_keys on each server; this option can be specified more than once") ) .arg( Arg::with_name("k8s-version") .short("v") .long("kubernetes-version") .takes_value(true) .required(true) .help("Version of Kubernetes to use, e.g. \"1.0.0\"") .validator(|version| { let version = version.as_str(); if version.starts_with('v') { return Err("Kubernetes version should be specified without the leading 'v'".to_string()); } if version >= "1.7" { return Ok(()); } else { return Err("This version of kaws supports only Kubernetes 1.7.0 or greater".to_string()); } }) ) .arg( Arg::with_name("zone-id") .short("z") .long("zone-id") .takes_value(true) .required(true) .help("Route 53 hosted zone ID") ) } fn cluster_generate_pki<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("generate-pki") .about("Generates public key infrastructure for a cluster") .setting(AppSettings::SubcommandRequiredElseHelp) .subcommand(cluster_generate_pki_all()) .subcommand(cluster_generate_pki_etcd()) .subcommand(cluster_generate_pki_etcd_peer()) .subcommand(cluster_generate_pki_kubernetes()) } fn cluster_generate_pki_all<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("all") .about("Generates all necessary public key infrastructure for a new cluster") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to generate PKI assets for") ) .arg( Arg::with_name("domain") .short("d") .long("domain") .takes_value(true) .required(true) .help("The base domain name for the cluster, e.g. \"example.com\"") ) .arg( Arg::with_name("kms-key") .short("k") .long("kms-key") .takes_value(true) .required(true) .help("KMS customer master key ID, e.g. \"12345678-1234-1234-1234-123456789012\"") ) .arg( Arg::with_name("region") .short("r") .long("region") .takes_value(true) .required(true) .help("AWS Region where the KMS key lives, e.g. \"us-east-1\"") ) } fn cluster_generate_pki_etcd<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("etcd") .about("Generates public key infrastructure for etcd's client API") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to generate PKI assets for") ) .arg( Arg::with_name("subject") .index(2) .required(true) .possible_values(&["ca", "client", "server"]) .help("The subject to generate PKI assets for") ) .arg( Arg::with_name("kms-key") .short("k") .long("kms-key") .takes_value(true) .required(true) .help("KMS customer master key ID, e.g. \"12345678-1234-1234-1234-123456789012\"") ) .arg( Arg::with_name("region") .short("r") .long("region") .takes_value(true) .required(true) .help("AWS Region where the KMS key lives, e.g. \"us-east-1\"") ) } fn cluster_generate_pki_etcd_peer<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("etcd-peer") .about("Generates public key infrastructure for etcd's peer API") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to generate PKI assets for") ) .arg( Arg::with_name("subject") .index(2) .required(true) .possible_values(&["ca", "peer"]) .help("The subject to generate PKI assets for") ) .arg( Arg::with_name("kms-key") .short("k") .long("kms-key") .takes_value(true) .required(true) .help("KMS customer master key ID, e.g. \"12345678-1234-1234-1234-123456789012\"") ) .arg( Arg::with_name("region") .short("r") .long("region") .takes_value(true) .required(true) .help("AWS Region where the KMS key lives, e.g. \"us-east-1\"") ) } fn cluster_generate_pki_kubernetes<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("kubernetes") .about("Generates public key infrastructure for Kubernetes") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster to generate PKI assets for") ) .arg( Arg::with_name("subject") .index(2) .required(true) .possible_values(&["ca", "masters", "nodes"]) .help("The subject to generate PKI assets for") ) .arg( Arg::with_name("domain") .short("d") .long("domain") .takes_value(true) .required(true) .help("The base domain name for the cluster, e.g. \"example.com\"") ) .arg( Arg::with_name("kms-key") .short("k") .long("kms-key") .takes_value(true) .required(true) .help("KMS customer master key ID, e.g. \"12345678-1234-1234-1234-123456789012\"") ) .arg( Arg::with_name("region") .short("r") .long("region") .takes_value(true) .required(true) .help("AWS Region where the KMS key lives, e.g. \"us-east-1\"") ) } fn cluster_output<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("output") .about("Displays the Terraform outputs for the target cluster") .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster whose plan should be displayed") ) .arg( Arg::with_name("output") .index(2) .help("The name of an individual output to display") ) } fn cluster_plan<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("plan") .about("Displays the Terraform plan for the target cluster") .setting(AppSettings::TrailingVarArg) .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster whose plan should be displayed") ) .arg( Arg::with_name("aws-credentials-path") .long("aws-credentials-path") .takes_value(true) .help("Path to the AWS credentials file, defaults to ~/.aws/credentials") ) .arg( Arg::with_name("aws-credentials-profile") .long("aws-credentials-profile") .takes_value(true) .help("Name of the AWS credentials profile to use, defaults to \"default\"") ) .arg( Arg::with_name("terraform-args") .index(2) .multiple(true) .hidden(true) .help("Additional arguments to be passed on to `terraform plan`") ) .after_help("\nAny arguments following a literal -- will be passed directly as options to `terraform plan`.") } fn cluster_refresh<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("refresh") .about("Refreshes the Terraform state for the target cluster") .setting(AppSettings::TrailingVarArg) .arg( Arg::with_name("cluster") .index(1) .required(true) .help("The cluster whose plan should be displayed") ) .arg( Arg::with_name("aws-credentials-path") .long("aws-credentials-path") .takes_value(true) .help("Path to the AWS credentials file, defaults to ~/.aws/credentials") ) .arg( Arg::with_name("aws-credentials-profile") .long("aws-credentials-profile") .takes_value(true) .help("Name of the AWS credentials profile to use, defaults to \"default\"") ) .arg( Arg::with_name("terraform-args") .index(2) .multiple(true) .hidden(true) .help("Additional arguments to be passed on to `terraform refresh`") ) .after_help("\nAny arguments following a literal -- will be passed directly as options to `terraform refresh`.") } fn init<'a, 'b>() -> App<'a, 'b> { SubCommand::with_name("init") .about("Initializes a new repository for managing Kubernetes clusters") .arg( Arg::with_name("name") .index(1) .required(true) .help("The name of the repository to create, e.g. \"example-company-infrastructure\"") ) .arg( Arg::with_name("terraform-source") .short("t") .long("terraform-source") .takes_value(true) .help("Custom source value for the Terraform module to use") ) }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/cluster.rs
src/cluster.rs
use std::fs::{create_dir_all, File}; use std::io::Write; use clap::ArgMatches; use rusoto_core::ChainProvider; use aws::credentials_provider; use encryption::Encryptor; use error::KawsResult; use pki::CertificateAuthority; pub struct Cluster<'a> { name: &'a str, region: &'a str, } pub struct ExistingCluster<'a> { aws_credentials_provider: ChainProvider, cluster: Cluster<'a>, domain: Option<&'a str>, kms_master_key_id: &'a str, subject: &'a str, } pub struct NewCluster<'a> { availability_zone: &'a str, aws_account_id: &'a str, cidr: &'a str, cluster: Cluster<'a>, coreos_ami: &'a str, domain: &'a str, iam_users: Vec<&'a str>, instance_size: &'a str, kubernetes_version: &'a str, masters_max_size: &'a str, masters_min_size: &'a str, nodes_max_size: &'a str, nodes_min_size: &'a str, ssh_keys: Vec<&'a str>, zone_id: &'a str, } impl<'a> Cluster<'a> { pub fn new(name: &'a str, region: &'a str) -> Self { Cluster { name: name, region: region, } } fn etcd_ca_cert_path(&self) -> String { format!("clusters/{}/etcd-ca.pem", self.name) } fn etcd_encrypted_ca_key_path(&self) -> String { format!("clusters/{}/etcd-ca-key-encrypted.base64", self.name) } fn etcd_server_cert_path(&self) -> String { format!("clusters/{}/etcd-server.pem", self.name) } fn etcd_encrypted_server_key_path(&self) -> String { format!("clusters/{}/etcd-server-key-encrypted.base64", self.name) } fn etcd_client_cert_path(&self) -> String { format!("clusters/{}/etcd-client.pem", self.name) } fn etcd_encrypted_client_key_path(&self) -> String { format!("clusters/{}/etcd-client-key-encrypted.base64", self.name) } fn etcd_peer_ca_cert_path(&self) -> String { format!("clusters/{}/etcd-peer-ca.pem", self.name) } fn etcd_peer_encrypted_ca_key_path(&self) -> String { format!("clusters/{}/etcd-peer-ca-key-encrypted.base64", self.name) } fn etcd_peer_cert_path(&self) -> String { format!("clusters/{}/etcd-peer.pem", self.name) } fn etcd_peer_encrypted_key_path(&self) -> String { format!("clusters/{}/etcd-peer-key-encrypted.base64", self.name) } fn k8s_ca_cert_path(&self) -> String { format!("clusters/{}/k8s-ca.pem", self.name) } fn k8s_encrypted_ca_key_path(&self) -> String { format!("clusters/{}/k8s-ca-key-encrypted.base64", self.name) } fn k8s_encrypted_master_key_path(&self) -> String { format!("clusters/{}/k8s-master-key-encrypted.base64", self.name) } fn k8s_encrypted_node_key_path(&self) -> String { format!("clusters/{}/k8s-node-key-encrypted.base64", self.name) } fn gitignore_path(&self) -> String { format!("clusters/{}/.gitignore", self.name) } fn k8s_master_cert_path(&self) -> String { format!("clusters/{}/k8s-master.pem", self.name) } fn name(&self) -> &str { self.name } fn k8s_node_cert_path(&self) -> String { format!("clusters/{}/k8s-node.pem", self.name) } fn region(&self) -> &str { self.region } fn tfvars_path(&self) -> String { format!("clusters/{}/terraform.tfvars", self.name) } } impl<'a> ExistingCluster<'a> { pub fn new(matches: &'a ArgMatches) -> Self { ExistingCluster { aws_credentials_provider: credentials_provider( matches.value_of("aws-credentials-path"), matches.value_of("aws-credentials-profile"), ), cluster: Cluster::new( matches.value_of("cluster").expect("missing cluster name"), matches.value_of("region").expect("missing region"), ), domain: matches.value_of("domain"), kms_master_key_id: matches.value_of("kms-key").expect("missing kms-key"), subject: matches.value_of("subject").unwrap_or("ca"), } } pub fn generate_pki_all(&mut self) -> KawsResult { self.generate_etcd_pki()?; self.generate_etcd_peer_pki()?; self.generate_kubernetes_pki()?; Ok(None) } pub fn generate_etcd_pki(&self) -> KawsResult { let mut encryptor = Encryptor::new( self.aws_credentials_provider.clone(), self.cluster.region().parse()?, Some(self.kms_master_key_id), ); let ca = if self.subject == "ca" { let ca = CertificateAuthority::generate( &format!("kaws-etcd-ca-{}", self.cluster.name) )?; ca.write_to_files( &mut encryptor, &self.cluster.etcd_ca_cert_path(), &self.cluster.etcd_encrypted_ca_key_path(), )?; ca } else { CertificateAuthority::from_files( &mut encryptor, &self.cluster.etcd_ca_cert_path(), &self.cluster.etcd_encrypted_ca_key_path(), )? }; if self.subject == "ca" || self.subject == "server" { let (server_cert, server_key) = ca.generate_cert( &format!("kaws-etcd-server-{}", self.cluster.name), Some(&[ "10.0.1.4", "10.0.1.5", "10.0.1.6", ]), None, )?; server_cert.write_to_file(&self.cluster.etcd_server_cert_path())?; server_key.write_to_file( &mut encryptor, &self.cluster.etcd_encrypted_server_key_path(), )?; } if self.subject == "ca" || self.subject == "client" { let (client_cert, client_key) = ca.generate_cert( &format!("kaws-etcd-client-{}", self.cluster.name), None, None, )?; client_cert.write_to_file(&self.cluster.etcd_client_cert_path())?; client_key.write_to_file( &mut encryptor, &self.cluster.etcd_encrypted_client_key_path(), )?; } Ok(None) } pub fn generate_etcd_peer_pki(&self) -> KawsResult { let mut encryptor = Encryptor::new( self.aws_credentials_provider.clone(), self.cluster.region().parse()?, Some(self.kms_master_key_id), ); let ca = if self.subject == "ca" { let ca = CertificateAuthority::generate( &format!("kaws-etcd-peer-ca-{}", self.cluster.name) )?; ca.write_to_files( &mut encryptor, &self.cluster.etcd_peer_ca_cert_path(), &self.cluster.etcd_peer_encrypted_ca_key_path(), )?; ca } else { CertificateAuthority::from_files( &mut encryptor, &self.cluster.etcd_peer_ca_cert_path(), &self.cluster.etcd_peer_encrypted_ca_key_path(), )? }; let (peer_cert, peer_key) = ca.generate_cert( &format!("kaws-etcd-peer-{}", self.cluster.name), Some(&[ "10.0.1.4", "10.0.1.5", "10.0.1.6", ]), None, )?; peer_cert.write_to_file(&self.cluster.etcd_peer_cert_path())?; peer_key.write_to_file( &mut encryptor, &self.cluster.etcd_peer_encrypted_key_path(), )?; Ok(None) } pub fn generate_kubernetes_pki(&self) -> KawsResult { let mut encryptor = Encryptor::new( self.aws_credentials_provider.clone(), self.cluster.region().parse()?, Some(self.kms_master_key_id), ); let ca = if self.subject == "ca" { let ca = CertificateAuthority::generate( &format!("kaws-k8s-ca-{}", self.cluster.name) )?; ca.write_to_files( &mut encryptor, &self.cluster.k8s_ca_cert_path(), &self.cluster.k8s_encrypted_ca_key_path(), )?; ca } else { CertificateAuthority::from_files( &mut encryptor, &self.cluster.k8s_ca_cert_path(), &self.cluster.k8s_encrypted_ca_key_path(), )? }; if self.subject == "ca" || self.subject == "masters" { let (master_cert, master_key) = ca.generate_cert( &format!("kaws-k8s-master-{}", self.cluster.name), Some(&[ "kubernetes", "kubernetes.default", "kubernetes.default.svc", "kubernetes.default.svc.cluster.local", &format!("kubernetes.{}", self.domain.expect("missing domain")), "10.3.0.1", ]), None, )?; master_cert.write_to_file(&self.cluster.k8s_master_cert_path())?; master_key.write_to_file( &mut encryptor, &self.cluster.k8s_encrypted_master_key_path(), )?; } if self.subject == "ca" || self.subject == "nodes" { let (node_cert, node_key) = ca.generate_cert( &format!("kaws-k8s-node-{}", self.cluster.name), None, Some(&["system:nodes"]), )?; node_cert.write_to_file(&self.cluster.k8s_node_cert_path())?; node_key.write_to_file( &mut encryptor, &self.cluster.k8s_encrypted_node_key_path(), )?; } Ok(None) } } impl<'a> NewCluster<'a> { pub fn new(matches: &'a ArgMatches) -> Self { NewCluster { availability_zone: matches .value_of("availability-zone") .expect("missing availability-zone"), aws_account_id: matches.value_of("aws-account-id").expect("missing aws-account-id"), cidr: matches.value_of("cidr").expect("missing cidr"), cluster: Cluster::new( matches.value_of("cluster").expect("missing cluster name"), matches.value_of("region").expect("missing region"), ), coreos_ami: matches.value_of("ami").expect("missing ami"), domain: matches.value_of("domain").expect("missing domain"), iam_users: matches .values_of("iam-user") .expect("missing iam-users") .collect(), instance_size: matches.value_of("size").expect("missing instance size"), kubernetes_version: matches.value_of("k8s-version").expect("missing k8s-version"), masters_max_size: matches .value_of("masters-max-size") .expect("missing masters-max-size"), masters_min_size: matches .value_of("masters-min-size") .expect("missing masters-min-size"), nodes_max_size: matches .value_of("nodes-max-size") .expect("missing nodes-max-size"), nodes_min_size: matches .value_of("nodes-min-size") .expect("missing nodes-min-size"), ssh_keys: matches.values_of("ssh-key").expect("missing ssh-keys").collect(), zone_id: matches.value_of("zone-id").expect("missing zone-id"), } } pub fn init(&mut self) -> KawsResult { self.create_directories()?; self.create_gitignore()?; self.create_tfvars()?; self.create_pki_stubs()?; Ok(Some(format!( "Cluster \"{name}\" initialized! Commit clusters/{name} to Git.", name = self.cluster.name, ))) } fn create_directories(&self) -> KawsResult { log_wrap!("Creating directories for the new cluster", { create_dir_all(format!("clusters/{}", self.cluster.name))?; }); Ok(None) } fn create_gitignore(&self) -> KawsResult { log_wrap!("Creating .gitignore file", { let mut file = File::create(&self.cluster.gitignore_path())?; write!(file, "*-key.pem")?; }); Ok(None) } fn create_tfvars(&self) -> KawsResult { log_wrap!("Creating tfvars file", { let mut file = File::create(&self.cluster.tfvars_path())?; write!( file, "\ kaws_account_id = \"{}\" kaws_availability_zone = \"{}\" kaws_cidr = \"{}\" kaws_cluster = \"{}\" kaws_coreos_ami = \"{}\" kaws_domain = \"{}\" kaws_iam_users = [{}] kaws_instance_size = \"{}\" kaws_masters_max_size = \"{}\" kaws_masters_min_size = \"{}\" kaws_nodes_max_size = \"{}\" kaws_nodes_min_size = \"{}\" kaws_propagating_vgws = [] kaws_region = \"{}\" kaws_ssh_keys = [{}] kaws_version = \"{}\" kaws_zone_id = \"{}\" ", self.aws_account_id, self.availability_zone, self.cidr, self.cluster.name(), self.coreos_ami, self.domain, self.iam_users.iter().map(|iam_user| { format!("\"{}\"", iam_user) }).collect::<Vec<String>>().join(", "), self.instance_size, self.masters_max_size, self.masters_min_size, self.nodes_max_size, self.nodes_min_size, self.cluster.region(), self.ssh_keys.iter().map(|ssh_key| { format!("\"{}\"", ssh_key) }).collect::<Vec<String>>().join(", "), self.kubernetes_version, self.zone_id, )?; }); Ok(None) } fn create_pki_stubs(&self) -> KawsResult { let paths = [ // etcd ca &self.cluster.etcd_ca_cert_path(), &self.cluster.etcd_encrypted_ca_key_path(), // etcd server &self.cluster.etcd_server_cert_path(), &self.cluster.etcd_encrypted_server_key_path(), // etcd clients &self.cluster.etcd_client_cert_path(), &self.cluster.etcd_encrypted_client_key_path(), // etcd peer ca &self.cluster.etcd_peer_ca_cert_path(), &self.cluster.etcd_peer_encrypted_ca_key_path(), // etcd peers &self.cluster.etcd_peer_cert_path(), &self.cluster.etcd_peer_encrypted_key_path(), // k8s ca &self.cluster.k8s_ca_cert_path(), &self.cluster.k8s_encrypted_ca_key_path(), // k8s masters &self.cluster.k8s_master_cert_path(), &self.cluster.k8s_encrypted_master_key_path(), // k8s nodes &self.cluster.k8s_node_cert_path(), &self.cluster.k8s_encrypted_node_key_path(), ]; for path in paths.iter() { File::create(path)?; } Ok(None) } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/pki.rs
src/pki.rs
use std::fs::File; use std::io::{Read, Write}; use std::process::{Command, Stdio}; use hyper::Client; use rusoto_core::ChainProvider; use serde_json::{from_slice, to_vec}; use tempdir::TempDir; use encryption::Encryptor; use error::{KawsError, KawsResult}; pub struct Certificate(Vec<u8>); pub struct CertificateAuthority { cert: Certificate, key: PrivateKey, } pub struct CertificateSigningRequest(Vec<u8>); pub struct PrivateKey(Vec<u8>); #[derive(Deserialize)] struct CfsslGencertResponse { cert: String, key: String, } #[derive(Deserialize)] struct CfsslSignResponse { cert: String, } #[derive(Deserialize)] struct CfsslGenkeyResponse { csr: String, key: String, } impl Certificate { pub fn from_file(path: &str) -> Result<Self, KawsError> { let mut file = File::open(path)?; let mut bytes = Vec::new(); file.read_to_end(&mut bytes)?; Ok(Certificate(bytes)) } pub fn write_to_file(&self, file_path: &str) -> KawsResult { let mut file = File::create(file_path)?; file.write_all(self.as_bytes())?; Ok(None) } pub fn as_bytes(&self) -> &[u8] { &self.0 } } impl From<String> for Certificate { fn from(string: String) -> Self { Certificate(string.into_bytes()) } } impl CertificateAuthority { pub fn from_files( encryptor: &mut Encryptor<ChainProvider, Client>, cert_path: &str, key_path: &str, ) -> Result<Self, KawsError> { let cert = Certificate::from_file(cert_path)?; let key = PrivateKey::from_file(encryptor, key_path)?; Ok(CertificateAuthority { cert: cert, key: key, }) } pub fn generate(common_name: &str) -> Result<Self, KawsError> { let mut command = Command::new("cfssl"); command.args(&[ "gencert", "-initca", "-", ]); command.stdin(Stdio::piped()); command.stdout(Stdio::piped()); command.stderr(Stdio::piped()); let mut child = command.spawn()?; match child.stdin.as_mut() { Some(stdin) => { let csr_config = json!({ "CN": common_name, "key": { "algo": "rsa", "size": 2048, }, }); stdin.write_all(&to_vec(&csr_config)?)?; } None => { return Err( KawsError::new("failed to acquire handle to stdin of child process".to_owned()) ); } } let output = child.wait_with_output()?; if output.status.success() { let raw: CfsslGencertResponse = from_slice(&output.stdout)?; Ok(raw.into()) } else { Err( KawsError::with_std_streams( "Execution of `cfssl genkey` failed.".to_owned(), String::from_utf8_lossy(&output.stdout).to_string(), String::from_utf8_lossy(&output.stderr).to_string(), ) ) } } pub fn generate_cert(&self, common_name: &str, san: Option<&[&str]>, groups: Option<&[&str]>) -> Result<(Certificate, PrivateKey), KawsError> { let mut csr_config = json!({ "CN": common_name, "key": { "algo": "rsa", "size": 2048, }, "names": [], }); if let Some(groups) = groups { let mut names = csr_config .get_mut("names") .expect("csr_config should have a names field") .as_array_mut() .expect("names should be an array"); for group in groups { names.push( json!({ "O": group, }) ); } } let (tempdir, cert_path, key_path) = self.temporary_write()?; let mut command = Command::new("cfssl"); command.args(&[ "gencert", "-ca", &cert_path, "-ca-key", &key_path, ]); if let Some(san) = san { command.args(&[ "-hostname", &san.join(","), ]); } command.arg("-"); command.stdin(Stdio::piped()); command.stdout(Stdio::piped()); command.stderr(Stdio::piped()); let mut child = command.spawn()?; match child.stdin.as_mut() { Some(stdin) => { stdin.write_all(&to_vec(&csr_config)?)?; } None => { return Err( KawsError::new("failed to acquire handle to stdin of child process".to_owned()) ); } } let output = child.wait_with_output()?; let result = if output.status.success() { let raw: CfsslGencertResponse = from_slice(&output.stdout)?; Ok((raw.cert.into(), raw.key.into())) } else { Err( KawsError::with_std_streams( "Execution of `cfssl gencert` failed.".to_owned(), String::from_utf8_lossy(&output.stdout).to_string(), String::from_utf8_lossy(&output.stderr).to_string(), ) ) }; tempdir.close()?; result } pub fn sign(&self, csr: &CertificateSigningRequest) -> Result<Certificate, KawsError> { let (tempdir, cert_path, key_path) = self.temporary_write()?; let mut command = Command::new("cfssl"); command.args(&[ "sign", "-ca", &cert_path, "-ca-key", &key_path, "-" ]); command.stdin(Stdio::piped()); command.stdout(Stdio::piped()); command.stderr(Stdio::piped()); let mut child = command.spawn()?; match child.stdin.as_mut() { Some(stdin) => { stdin.write_all(csr.as_bytes())?; } None => { return Err( KawsError::new("failed to acquire handle to stdin of child process".to_owned()) ); } } let output = child.wait_with_output()?; let result = if output.status.success() { let response: CfsslSignResponse = from_slice(&output.stdout)?; Ok(response.cert.into()) } else { Err( KawsError::with_std_streams( "Execution of `cfssl cert` failed.".to_owned(), String::from_utf8_lossy(&output.stdout).to_string(), String::from_utf8_lossy(&output.stderr).to_string(), ) ) }; tempdir.close()?; result } pub fn write_to_files( &self, encryptor: &mut Encryptor<ChainProvider, Client>, cert_file_path: &str, key_file_path: &str, ) -> KawsResult { let mut cert_file = File::create(cert_file_path)?; cert_file.write_all(self.as_bytes())?; encryptor.encrypt_and_write_file(self.key.as_bytes(), key_file_path)?; Ok(None) } pub fn as_bytes(&self) -> &[u8] { self.cert.as_bytes() } // Private fn temporary_write(&self) -> Result<(TempDir, String, String), KawsError> { let tempdir = TempDir::new("kaws")?; let cert_path = tempdir.path().join("cert.pem"); let key_path = tempdir.path().join("key.pem"); let cert_path_string = match cert_path.to_str() { Some(value) => value.to_owned(), None => return Err(KawsError::new("Temporary path was invalid UTF-8".to_owned())), }; let key_path_string = match key_path.to_str() { Some(value) => value.to_owned(), None => return Err(KawsError::new("Temporary path was invalid UTF-8".to_owned())), }; let mut cert_file = File::create(cert_path)?; let mut key_file = File::create(key_path)?; cert_file.write_all(self.cert.as_bytes())?; key_file.write_all(self.key.as_bytes())?; Ok((tempdir, cert_path_string, key_path_string)) } } impl From<CfsslGencertResponse> for CertificateAuthority { fn from(raw: CfsslGencertResponse) -> Self { CertificateAuthority { cert: raw.cert.into(), key: raw.key.into(), } } } impl CertificateSigningRequest { pub fn from_file(file_path: &str) -> Result<Self, KawsError> { let mut file = File::open(file_path)?; let mut bytes = Vec::new(); file.read_to_end(&mut bytes)?; Ok(CertificateSigningRequest(bytes)) } pub fn generate(common_name: &str, groups: Option<&Vec<&str>>) -> Result<(CertificateSigningRequest, PrivateKey), KawsError> { let mut csr_config = json!({ "CN": common_name, "key": { "algo": "rsa", "size": 2048, }, "names": [], }); if let Some(groups) = groups { let mut names = csr_config .get_mut("names") .expect("csr_config should have a names field") .as_array_mut() .expect("names should be an array"); for group in groups { names.push( json!({ "O": group, }) ); } } let mut command = Command::new("cfssl"); command.args(&[ "genkey", "-", ]); command.stdin(Stdio::piped()); command.stdout(Stdio::piped()); command.stderr(Stdio::piped()); let mut child = command.spawn()?; match child.stdin.as_mut() { Some(stdin) => { stdin.write_all(&to_vec(&csr_config)?)?; } None => { return Err( KawsError::new("failed to acquire handle to stdin of child process".to_owned()) ); } }; let output = child.wait_with_output()?; if output.status.success() { let raw: CfsslGenkeyResponse = from_slice(&output.stdout)?; Ok((CertificateSigningRequest(raw.csr.into_bytes()), PrivateKey(raw.key.into_bytes()))) } else { Err( KawsError::with_std_streams( "Execution of `cfssl genkey` failed.".to_owned(), String::from_utf8_lossy(&output.stdout).to_string(), String::from_utf8_lossy(&output.stderr).to_string(), ) ) } } pub fn write_to_file(&self, file_path: &str) -> KawsResult { let mut file = File::create(file_path)?; file.write_all(self.as_bytes())?; Ok(None) } pub fn as_bytes(&self) -> &[u8] { &self.0 } } impl From<String> for CertificateSigningRequest { fn from(string: String) -> Self { CertificateSigningRequest(string.into_bytes()) } } impl PrivateKey { pub fn from_file(encryptor: &mut Encryptor<ChainProvider, Client>, path: &str) -> Result<Self, KawsError> { let bytes = encryptor.decrypt_file(path)?; Ok(PrivateKey(bytes)) } pub fn as_bytes(&self) -> &[u8] { &self.0 } pub fn write_to_file( &self, encryptor: &mut Encryptor<ChainProvider, Client>, file_path: &str, ) -> KawsResult { encryptor.encrypt_and_write_file(self.as_bytes(), file_path)?; Ok(None) } pub fn write_to_file_unencrypted(&self, file_path: &str) -> KawsResult { let mut file = File::create(file_path)?; file.write_all(self.as_bytes())?; Ok(None) } } impl From<String> for PrivateKey { fn from(string: String) -> Self { PrivateKey(string.into_bytes()) } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/error.rs
src/error.rs
use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt::Error as FmtError; use std::str::Utf8Error; use rusoto_core::ParseRegionError; use rusoto_kms::{DecryptError, EncryptError}; use rustc_serialize::base64::FromBase64Error; use serde_json::Error as SerdeJsonError; pub struct KawsError { message: String, stderr: Option<String>, stdout: Option<String>, } impl KawsError { pub fn new(message: String) -> KawsError { KawsError { message: message, stderr: None, stdout: None, } } pub fn with_std_streams(message: String, stdout: String, stderr: String) -> KawsError { KawsError { message: message, stderr: Some(stderr), stdout: Some(stdout), } } } impl Debug for KawsError { fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { write!(f, "{:?}", self.message) } } impl Display for KawsError { fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { if self.stdout.is_some() && self.stderr.is_some() { write!(f, "{} Standard streams from the underlying command that failed: stdout: {} stderr: {}", self.message, self.stdout.as_ref().expect("accessing self.stdout"), self.stderr.as_ref().expect("accessing self.stderr") ) } else { write!(f, "{}", self.message) } } } impl Error for KawsError { fn description(&self) -> &str { &self.message } } impl From<::std::io::Error> for KawsError { fn from(error: ::std::io::Error) -> Self { KawsError::new(format!("{}", error)) } } impl From<Utf8Error> for KawsError { fn from(error: Utf8Error) -> Self { KawsError::new(format!("{}", error)) } } impl From<DecryptError> for KawsError { fn from(error: DecryptError) -> Self { KawsError::new(format!("{}", error)) } } impl From<EncryptError> for KawsError { fn from(error: EncryptError) -> Self { KawsError::new(format!("{}", error)) } } impl From<FromBase64Error> for KawsError { fn from(error: FromBase64Error) -> Self { KawsError::new(format!("{}", error)) } } impl From<ParseRegionError> for KawsError { fn from(error: ParseRegionError) -> Self { KawsError::new(format!("{}", error)) } } impl From<SerdeJsonError> for KawsError { fn from(error: SerdeJsonError) -> Self { KawsError::new(format!("{}", error)) } } pub type KawsResult = Result<Option<String>, KawsError>;
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/admin.rs
src/admin.rs
use std::fs::create_dir_all; use std::process::Command; use clap::ArgMatches; use rusoto_core::ChainProvider; use aws::credentials_provider; use encryption::Encryptor; use error::KawsResult; use pki::{CertificateAuthority, CertificateSigningRequest}; use process::execute_child_process; pub struct Admin<'a> { admin: &'a str, aws_credentials_provider: ChainProvider, cluster: &'a str, groups: Option<Vec<&'a str>>, } impl<'a> Admin<'a> { pub fn new(matches: &'a ArgMatches) -> Self { Admin { admin: matches.value_of("name").expect("clap should have required name"), aws_credentials_provider: credentials_provider( matches.value_of("aws-credentials-path"), matches.value_of("aws-credentials-profile"), ), cluster: matches.value_of("cluster").expect("clap should have required cluster"), groups: matches.values_of("group").map(|values| values.collect()), } } pub fn create(&mut self) -> KawsResult { log_wrap!("Creating directory for the new administrator's credentials", { create_dir_all(format!("clusters/{}", self.cluster))?; }); let (csr, key) = CertificateSigningRequest::generate(self.admin, self.groups.as_ref())?; let csr_path = format!( "clusters/{}/{}-csr.pem", self.cluster, self.admin, ); let key_path = format!( "clusters/{}/{}-key.pem", self.cluster, self.admin, ); csr.write_to_file(&csr_path)?; key.write_to_file_unencrypted(&key_path)?; Ok(Some(format!( "Certificate signing request created! Commit changes to Git and ask an\n\ administrator to generate your client certificate." ))) } pub fn install(&mut self) -> KawsResult { let domain = self.domain()?.expect( "Terraform should have had a value for the domain output" ); log_wrap!("Configuring kubectl", { // set cluster execute_child_process("kubectl", &[ "config", "set-cluster", &format!("kaws-{}", self.cluster), &format!("--server=https://kubernetes.{}", &domain), &format!("--certificate-authority=clusters/{}/k8s-ca.pem", self.cluster), "--embed-certs=true", ])?; // set credentials execute_child_process("kubectl", &[ "config", "set-credentials", &format!("kaws-{}-{}", self.cluster, self.admin), &format!("--client-certificate=clusters/{}/{}.pem", self.cluster, self.admin), &format!("--client-key=clusters/{}/{}-key.pem", self.cluster, self.admin), "--embed-certs=true", ])?; // set context execute_child_process("kubectl", &[ "config", "set-context", &format!("kaws-{}", self.cluster), &format!("--cluster=kaws-{}", self.cluster), &format!("--user=kaws-{}-{}", self.cluster, self.admin), ])?; }); Ok(Some(format!( "Admin credentials for user \"{admin}\" installed for cluster \"{cluster}\"!\n\ To activate these settings as the current context, run:\n\n\ kubectl config use-context kaws-{cluster}\n\n\ If the kubectl configuration file is ever removed or changed accidentally,\n\ just run this command again to regenerate or reconfigure it.", admin = self.admin, cluster = self.cluster, ))) } pub fn sign(&mut self) -> KawsResult { let region = self.region()?.expect( "Terraform should have had a value for the region output" ); let admin_csr_path = format!("clusters/{}/{}-csr.pem", self.cluster, self.admin); let admin_cert_path = format!("clusters/{}/{}.pem", self.cluster, self.admin); let ca_cert_path = format!("clusters/{}/k8s-ca.pem", self.cluster); let encrypted_ca_key_path = format!("clusters/{}/k8s-ca-key-encrypted.base64", self.cluster); let mut encryptor = Encryptor::new( self.aws_credentials_provider.clone(), region.parse()?, None, ); let ca = CertificateAuthority::from_files( &mut encryptor, &ca_cert_path, &encrypted_ca_key_path, )?; let csr = CertificateSigningRequest::from_file(&admin_csr_path)?; let cert = ca.sign(&csr)?; cert.write_to_file(&admin_cert_path)?; Ok(Some(format!( "Client certificate for administrator \"{}\" created for cluster \"{}\"!\n\ Commit changes to Git and ask the administrator to run `kaws admin install`.", self.admin, self.cluster, ))) } fn domain(&self) -> KawsResult { self.output("domain") } fn region(&self) -> KawsResult { self.output("region") } fn output(&self, output_name: &str) -> KawsResult { let output = Command::new("kaws") .args(&["cluster", "output", self.cluster, output_name]) .output()?; Ok(Some(String::from_utf8_lossy(&output.stdout).trim_right().to_string())) } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/terraform.rs
src/terraform.rs
use std::process::{Command, Stdio}; use clap::ArgMatches; use rusoto_core::{ChainProvider, ProvideAwsCredentials}; use aws::credentials_provider; use error::{KawsError, KawsResult}; pub struct Terraform<'a> { aws_credentials_provider: ChainProvider, cluster: &'a str, output: Option<&'a str>, terraform_args: Option<Vec<&'a str>>, } impl<'a> Terraform<'a> { pub fn new(matches: &'a ArgMatches) -> Terraform<'a> { Terraform { aws_credentials_provider: credentials_provider( matches.value_of("aws-credentials-path"), matches.value_of("aws-credentials-profile"), ), cluster: matches.value_of("cluster").expect("clap should have required cluster"), output: matches.value_of("output"), terraform_args: matches.values_of("terraform-args").map(|values| values.collect()), } } pub fn apply(&mut self) -> KawsResult { self.init()?; let mut command = Command::new("terraform"); command.args(&[ "apply", "-backup=-", &format!("-state=clusters/{}/terraform.tfstate", self.cluster), &format!("-var-file=clusters/{}/terraform.tfvars", self.cluster), ]); if self.terraform_args.is_some() { command.args(self.terraform_args.as_ref().unwrap()); } command.arg("terraform").env( "AWS_ACCESS_KEY_ID", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_access_key_id(), ).env( "AWS_SECRET_ACCESS_KEY", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_secret_access_key(), ); command.status()?; Ok(None) } pub fn destroy(&mut self) -> KawsResult { self.init()?; let mut command = Command::new("terraform"); command.args(&[ "destroy", "-backup=-", &format!("-state=clusters/{}/terraform.tfstate", self.cluster), &format!("-var-file=clusters/{}/terraform.tfvars", self.cluster), ]); if self.terraform_args.is_some() { command.args(self.terraform_args.as_ref().unwrap()); } command.arg("terraform").env( "AWS_ACCESS_KEY_ID", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_access_key_id(), ).env( "AWS_SECRET_ACCESS_KEY", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_secret_access_key(), ); let exit_status = command.status()?; if exit_status.success() { Ok(Some(format!( "Destroyed cluster \"{}\"! You should remove clusters/{} from Git.", self.cluster, self.cluster, ))) } else { Err(KawsError::new(format!("Failed to destroy cluster!"))) } } pub fn output(&mut self) -> KawsResult { self.init()?; let mut command = Command::new("terraform"); command.args(&[ "output", "-module=kaws", &format!("-state=clusters/{}/terraform.tfstate", self.cluster), ]); if let Some(output) = self.output { command.arg(output); } command.status()?; Ok(None) } pub fn plan(&mut self) -> KawsResult { self.init()?; let mut command = Command::new("terraform"); command.args(&[ "plan", "-module-depth=-1", &format!("-state=clusters/{}/terraform.tfstate", self.cluster), &format!("-var-file=clusters/{}/terraform.tfvars", self.cluster), ]); if self.terraform_args.is_some() { command.args(self.terraform_args.as_ref().unwrap()); } command.arg("terraform").env( "AWS_ACCESS_KEY_ID", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_access_key_id(), ).env( "AWS_SECRET_ACCESS_KEY", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_secret_access_key(), ); command.status()?; Ok(None) } pub fn refresh(&mut self) -> KawsResult { self.init()?; let mut command = Command::new("terraform"); command.args(&[ "refresh", "-backup=-", &format!("-state=clusters/{}/terraform.tfstate", self.cluster), &format!("-var-file=clusters/{}/terraform.tfvars", self.cluster), ]); if self.terraform_args.is_some() { command.args(self.terraform_args.as_ref().unwrap()); } command.arg("terraform").env( "AWS_ACCESS_KEY_ID", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_access_key_id(), ).env( "AWS_SECRET_ACCESS_KEY", self.aws_credentials_provider.credentials().expect( "Failed to get AWS credentials" ).aws_secret_access_key(), ); command.status()?; Ok(None) } fn init(&self) -> KawsResult { let exit_status = Command::new("terraform").args(&[ "init", "terraform", ]).stdout(Stdio::null()).status()?; if exit_status.success() { Ok(None) } else { Err(KawsError::new("Failed to initialize Terraform!".to_string())) } } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/main.rs
src/main.rs
extern crate ansi_term; extern crate bitstring; extern crate env_logger; extern crate cidr; extern crate clap; #[macro_use] extern crate log; extern crate hyper; extern crate rusoto_core; extern crate rusoto_kms; extern crate rustc_serialize; extern crate serde; #[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_json; extern crate tempdir; macro_rules! log_wrap { ($m:expr, $b:block) => { debug!("{}...", $m); $b debug!("...done."); } } mod admin; mod aws; mod cli; mod cluster; mod dependencies; mod encryption; mod error; mod pki; mod process; mod repository; mod terraform; use std::process::exit; use ansi_term::Colour::{Green, Red}; use admin::Admin; use cluster::{ExistingCluster, NewCluster}; use dependencies::ensure_dependencies; use error::KawsResult; use repository::Repository; use terraform::Terraform; fn main() { env_logger::init().expect("Failed to initialize logger."); let mut failed = false; match execute_cli() { Ok(success) => { if let Some(message) = success { println!("{}", Green.paint(message.to_string())); } }, Err(error) => { let error_output = format!("Error:\n{}", error); println!("{}", Red.paint(error_output)); failed = true; }, } if failed { exit(1); } } fn execute_cli() -> KawsResult { let app_matches = cli::app().get_matches(); match app_matches.subcommand() { ("admin", Some(admin_matches)) => { ensure_dependencies()?; match admin_matches.subcommand() { ("create", Some(matches)) => Admin::new(matches).create(), ("install", Some(matches)) => Admin::new(matches).install(), ("sign", Some(matches)) => Admin::new(matches).sign(), _ => { println!("{}", admin_matches.usage()); Ok(None) } } }, ("cluster", Some(cluster_matches)) => { ensure_dependencies()?; match cluster_matches.subcommand() { ("apply", Some(matches)) => Terraform::new(matches).apply(), ("destroy", Some(matches)) => Terraform::new(matches).destroy(), ("init", Some(matches)) => NewCluster::new(matches).init(), ("generate-pki", Some(generate_pki_matches)) => { match generate_pki_matches.subcommand() { ("all", Some(matches)) => { ExistingCluster::new(matches).generate_pki_all() } ("etcd", Some(matches)) => { ExistingCluster::new(matches).generate_etcd_pki() } ("etcd-peer", Some(matches)) => { ExistingCluster::new(matches).generate_etcd_peer_pki() } ("kubernetes", Some(matches)) => { ExistingCluster::new(matches).generate_kubernetes_pki() } _ => { println!("{}", generate_pki_matches.usage()); Ok(None) } } } ("output", Some(matches)) => Terraform::new(matches).output(), ("plan", Some(matches)) => Terraform::new(matches).plan(), ("refresh", Some(matches)) => Terraform::new(matches).refresh(), _ => { println!("{}", cluster_matches.usage()); Ok(None) } } }, ("init", Some(matches)) => { ensure_dependencies()?; Repository::new(matches).create() } _ => { println!("{}", app_matches.usage()); Ok(None) }, } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/dependencies.rs
src/dependencies.rs
use std::process::{Command, Stdio}; use error::{KawsError, KawsResult}; pub fn ensure_dependencies() -> KawsResult { ensure_cfssl().and(ensure_kubectl()).and(ensure_terraform()) } fn ensure_cfssl() -> KawsResult { let installed = match Command::new("cfssl") .arg("version") .stdout(Stdio::null()) .stderr(Stdio::null()) .status() { Ok(status) => status.success(), Err(_) => false, }; if installed { Ok(None) } else { Err(KawsError::new("cfssl must be installed".to_string())) } } fn ensure_kubectl() -> KawsResult { let installed = match Command::new("kubectl") .stdout(Stdio::null()) .stderr(Stdio::null()) .status() { Ok(status) => status.success(), Err(_) => false, }; if installed { Ok(None) } else { Err(KawsError::new("kubectl must be installed".to_string())) } } fn ensure_terraform() -> KawsResult { let installed = match Command::new("terraform") .arg("version") .stdout(Stdio::null()) .stderr(Stdio::null()) .status() { Ok(status) => status.success(), Err(_) => false, }; if installed { Ok(None) } else { Err(KawsError::new("terraform must be installed".to_string())) } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/repository.rs
src/repository.rs
use std::fs::{create_dir_all, File}; use std::io::Write; use clap::ArgMatches; use error::KawsResult; pub struct Repository<'a> { name: &'a str, terraform_source: &'a str, } impl<'a> Repository<'a> { pub fn new(matches: &'a ArgMatches) -> Self { Repository { name: matches.value_of("name").expect("clap should have required name"), terraform_source: matches.value_of("terraform-source").unwrap_or( concat!("github.com/InQuicker/kaws//terraform?ref=", env!("CARGO_PKG_VERSION")), ), } } pub fn create(&self) -> KawsResult { create_dir_all(format!("{}/clusters", self.name))?; create_dir_all(format!("{}/terraform", self.name))?; let mut gitignore = File::create(format!("{}/.gitignore", self.name))?; writeln!(&mut gitignore, ".terraform")?; let mut main_tf = File::create(format!("{}/terraform/kaws.tf", self.name))?; write!( &mut main_tf, r#"module "kaws" {{ source = "{}" account_id = "${{var.kaws_account_id}}" availability_zone = "${{var.kaws_availability_zone}}" cidr = "${{var.kaws_cidr}}" cluster = "${{var.kaws_cluster}}" coreos_ami = "${{var.kaws_coreos_ami}}" domain = "${{var.kaws_domain}}" iam_users = ["${{var.kaws_iam_users}}"] instance_size = "${{var.kaws_instance_size}}" masters_max_size = "${{var.kaws_masters_max_size}}" masters_min_size = "${{var.kaws_masters_min_size}}" nodes_max_size = "${{var.kaws_nodes_max_size}}" nodes_min_size = "${{var.kaws_nodes_min_size}}" propagating_vgws = ["${{var.kaws_propagating_vgws}}"] region = "${{var.kaws_region}}" ssh_keys = ["${{var.kaws_ssh_keys}}"] version = "${{var.kaws_version}}" zone_id = "${{var.kaws_zone_id}}" }} variable "kaws_account_id" {{ description = "Numerical account ID of the AWS account to use, e.g. `12345678`" }} variable "kaws_availability_zone" {{ description = "Availability Zone for etcd instances and EBS volumes, e.g. `us-east-1a`" }} variable "kaws_cidr" {{ description = "IPv4 network range of the subnet where Kubernetes nodes will run, e.g. `10.0.2.0/24`" }} variable "kaws_cluster" {{ description = "The target cluster's name, e.g. `production`" }} variable "kaws_coreos_ami" {{ description = "The AMI ID for the CoreOS image to use for servers, e.g. `ami-1234abcd`" }} variable "kaws_domain" {{ description = "The domain name for the cluster, e.g. `example.com`" }} variable "kaws_iam_users" {{ description = "A list of IAM user names who will have access to cluster PKI secrets" type = "list" }} variable "kaws_instance_size" {{ description = "The EC2 instance size, e.g. `m3.medium`" }} variable "kaws_masters_max_size" {{ description = "The maximum number of EC2 instances the Kubernetes masters may autoscale to" }} variable "kaws_masters_min_size" {{ description = "The minimum number of EC2 instances the Kubernetes masters may autoscale to" }} variable "kaws_nodes_max_size" {{ description = "The maximum number of EC2 instances the Kubernetes nodes may autoscale to" }} variable "kaws_nodes_min_size" {{ description = "The minimum number of EC2 instances the Kubernetes nodes may autoscale to" }} variable "kaws_propagating_vgws" {{ description = "A list of virtual gateways that should propagate routes to the route table" type = "list" }} variable "kaws_region" {{ description = "The AWS Region where the cluster will live, e.g. `us-east-1`" }} variable "kaws_ssh_keys" {{ description = "SSH public keys to add to ~/.ssh/authorized_keys on each server" type = "list" }} variable "kaws_version" {{ description = "Version of Kubernetes to use, e.g. `1.0.0`" }} variable "kaws_zone_id" {{ description = "Zone ID of the Route 53 hosted zone, e.g. `Z111111QQQQQQQ`" }} "#, self.terraform_source, )?; Ok(Some(format!("New repository \"{}\" created!", self.name))) } }
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami/build.rs
kiwami/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/kiwami.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami/src/main.rs
kiwami/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos, SetCursorPos}; const INITIAL_POS: i32 = 500; extern "C" { static get_camera_data: u8; static get_camera_data_end: u8; static get_controller_input: u8; static get_controller_input_end: u8; } pub fn main() -> Result<(), Error> { let mut mouse_pos: POINT = POINT::default(); // latest mouse positions let mut latest_x = 0; let mut latest_y = 0; println!("Yakuza Kiwami Freecam v{} by @etra0", get_version()); println!( " INSTRUCTIONS: PAUSE/L2 + X - Activate/Deactivate Free Camera END/L2 + Square - Pause the cinematic DEL - Deattach Mouse W, A, S, D/Left Stick - Move the camera Mouse/Right Stick - Point the camera CTRL, SPACE/TRIANGLE, X - Move UP or DOWN PG UP, PG DOWN/DPAD UP, DPAD DOWN - Increase/Decrease speed multiplier DPAD LEFT, DPAD RIGHT - Increase/Decrease Right Stick Sensitivity F1, F2/L2, R2 - Increase/Decrease FOV respectively Q, E/L1, R1 - Rotate the camera WARNING: Once you deattach the camera (PAUSE), your mouse will be set in a fixed position, so in order to attach/deattach the mouse to the camera, you can press DEL WARNING: If you're in freeroam and you stop hearing audio, it's probably because you have the paused option activated, simply press END to deactivate it. " ); println!("Waiting for the game to start"); let yakuza = loop { if let Ok(p) = Process::new("YakuzaKiwami.exe") { break Rc::new(p); }; thread::sleep(Duration::from_secs(5)); }; println!("Game hooked"); let entry_point: usize = 0x30CC33; let entry_point_size: usize = 8; let p_shellcode = unsafe { yakuza.inject_shellcode( entry_point, entry_point_size, &get_camera_data as *const u8, &get_camera_data_end as *const u8, ) }; let p_controller = unsafe { yakuza.inject_shellcode( 0x18C00B, 6, &get_controller_input as *const u8, &get_controller_input_end as *const u8, ) }; let mut cam = Camera::new(yakuza.clone(), p_shellcode); // function that changes the focal length of the cinematics, when // active, nop this cam.injections.push(Injection { entry_point: 0x187616, f_orig: vec![0xF3, 0x0F, 0x11, 0x89, 0xAC, 0x00, 0x00, 0x00], f_rep: vec![0x90; 8], }); // WIP: Pause the cinematics of the world. let pause_cinematic_f: Vec<u8> = vec![0x41, 0x8A, 0x8D, 0xD1, 0x00, 0x00, 0x00]; let pause_cinematic_rep: Vec<u8> = vec![0xB1, 0x01, 0x90, 0x90, 0x90, 0x90, 0x90]; let pause_cinematic_offset = 0x7BB8C; let mut pause_world = false; let mut active = false; let mut capture_mouse = false; let mut restart_mouse = false; loop { if capture_mouse & restart_mouse { unsafe { SetCursorPos(INITIAL_POS, INITIAL_POS) }; restart_mouse = !restart_mouse; latest_x = INITIAL_POS; latest_y = INITIAL_POS; continue; } let start = Instant::now(); // poll rate thread::sleep(Duration::from_millis(10)); unsafe { GetCursorPos(&mut mouse_pos) }; let duration = start.elapsed().as_millis() as f32; let speed_x = ((mouse_pos.x - latest_x) as f32) / duration / 100.; let speed_y = ((mouse_pos.y - latest_y) as f32) / duration / 100.; let controller_structure_p: usize = yakuza.read_value(p_controller + 0x200, true); let controller_state = match controller_structure_p { 0 => 0, _ => yakuza.read_value::<u64>(controller_structure_p, true), }; if active && capture_mouse { cam.update_position(speed_x, speed_y); unsafe { cam.handle_keyboard_input() }; } if active && (controller_structure_p != 0) { let [pos_x, pos_y, pitch, yaw] = yakuza.read_value::<[f32; 4]>(controller_structure_p + 0x10, true); // L1 & R1 check match controller_state & 0x30 { 0x20 => cam.update_fov(0.01), 0x10 => cam.update_fov(-0.01), _ => (), }; let speed: i8 = match controller_state & 0x3000 { 0x1000 => 1, 0x2000 => -1, _ => 0, }; let dp_up = match controller_state & 0x9 { 0x8 => 2f32, 0x1 => -2f32, _ => 0f32, }; let dir_speed = match controller_state & 0xC000 { 0x8000 => 1, 0x4000 => -1, _ => 0, }; let rotation: i8 = match controller_state & 0xC0 { 0x40 => 1, 0x80 => -1, 0xC0 => 2, _ => 0, }; cam.update_values(-pos_y, -pos_x, dp_up, speed, dir_speed, rotation); //dp_up, speed, dir_speed, rotation); cam.update_position(pitch, yaw); } latest_x = mouse_pos.x; latest_y = mouse_pos.y; // to scroll infinitely restart_mouse = !restart_mouse; unsafe { if (controller_state & 0x11 == 0x11) || (GetAsyncKeyState(winuser::VK_PAUSE) as u32 & 0x8000) != 0 { active = !active; if controller_state & 0x11 != 0x11 { capture_mouse = active; } let c_status = if active { "Deattached" } else { "Attached" }; println!("status of camera: {}", c_status); if active { cam.deattach(); } else { cam.attach(); } thread::sleep(Duration::from_millis(500)); } if active & (GetAsyncKeyState(winuser::VK_DELETE) as u32 & 0x8000 != 0) { capture_mouse = !capture_mouse; let c_status = if !capture_mouse { "Deattached" } else { "Attached" }; println!("status of mouse: {}", c_status); thread::sleep(Duration::from_millis(500)); } if (controller_state & 0x14 == 0x14) || (GetAsyncKeyState(winuser::VK_END) as u32 & 0x8000) != 0 { pause_world = !pause_world; println!("status of pausing: {}", pause_world); if pause_world { yakuza.write_aob(pause_cinematic_offset, &pause_cinematic_rep, false); } else { yakuza.write_aob(pause_cinematic_offset, &pause_cinematic_f, false); } thread::sleep(Duration::from_millis(500)); } } } }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami2/build.rs
kiwami2/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/kiwami2.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami2/src/main.rs
kiwami2/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos, SetCursorPos}; const INITIAL_POS: i32 = 500; static mut ORIGINAL_VAL_UI: [u32; 5] = [0; 5]; extern "C" { static get_camera_data: u8; static get_camera_data_end: u8; static get_pause_value: u8; static get_pause_value_end: u8; static get_controller_input: u8; static get_controller_input_end: u8; } fn detect_activation_by_controller(value: u64) -> bool { let result = value & 0x11; result == 0x11 } fn trigger_pause(process: &Process, addr: usize) { if addr == 0x0 { return; } process.write_value::<u8>(addr, 0x1, true); thread::sleep(Duration::from_millis(100)); process.write_value::<u8>(addr, 0x0, true); } fn remove_ui(process: &Process, activate: bool) { let offsets: Vec<usize> = vec![0x291D1DC, 0x291D1D0, 0x291D1EC, 0x291D1E8, 0x291D1E4]; unsafe { if ORIGINAL_VAL_UI[0] == 0 { for (i, offset) in offsets.iter().enumerate() { ORIGINAL_VAL_UI[i] = process.read_value::<u32>(*offset, false); } } for (i, offset) in offsets.iter().enumerate() { if activate { process.write_value::<i32>(*offset, -1, false); } else { process.write_value::<u32>(*offset, ORIGINAL_VAL_UI[i], false); } } } } pub fn main() -> Result<(), Error> { let mut mouse_pos: POINT = POINT::default(); // latest mouse positions let mut latest_x = 0; let mut latest_y = 0; println!("Yakuza Kiwami 2 Freecam v{} by @etra0", get_version()); println!( " INSTRUCTIONS: PAUSE/L2 + X - Activate/Deactivate Free Camera DEL - Deattach Mouse WASD/Left Stick - Move in the direction you're pointing Mouse/Right Stick - Point CTRL, SPACE/TRIANGLE, X - Move UP or DOWN PG UP, PG DOWN/DPAD UP, DPAD DOWN - Increase/Decrease speed multiplier DPAD LEFT, DPAD RIGHT - Increase/Decrease Right Stick Sensitivity F1, F2/L2, R2 - Increase/Decrease FOV respectively Q, E/L1, R1 - Rotate the camera WARNING: Don't forget to deactivate the freecam before skipping a cutscene (it may cause a game freeze) WARNING: Once you deattach the camera (PAUSE), your mouse will be set in a fixed position, so in order to attach/deattach the mouse to the camera, you can press DEL " ); println!("Waiting for the game to start"); let yakuza = loop { if let Ok(p) = Process::new("YakuzaKiwami2.exe") { break Rc::new(p); }; thread::sleep(Duration::from_secs(5)); }; println!("Game hooked"); let entry_point: usize = 0x1F0222B; let p_shellcode = unsafe { yakuza.inject_shellcode( entry_point, 9, &get_camera_data as *const u8, &get_camera_data_end as *const u8, ) }; let p_controller = unsafe { yakuza.inject_shellcode( 0x1B98487, 8, &get_controller_input as *const u8, &get_controller_input_end as *const u8, ) }; let pause_value_ep: usize = 0xDF5E1B; let pause_value = unsafe { yakuza.inject_shellcode( pause_value_ep, 7, &get_pause_value as *const u8, &get_pause_value_end as *const u8, ) }; let mut cam = Camera::new(yakuza.clone(), p_shellcode); // function that changes the focal length of the cinematics, when // active, nop this cam.injections.push(Injection { entry_point: 0xB78D87, f_orig: vec![0x89, 0x86, 0xB8, 0x00, 0x00, 0x00], f_rep: vec![0x90; 6], }); // nop the setcursorpos inside the game cam.injections.push(Injection { entry_point: 0x1BA285B, f_orig: vec![0xFF, 0x15, 0x47, 0x52, 0x4A, 0x00], f_rep: vec![0x90; 6], }); // WIP: Pause the cinematics of the world. cam.injections.push(Injection { entry_point: 0xDF6F86, f_orig: vec![0x0F, 0x84, 0x5E, 0x02, 0x00, 0x00], f_rep: vec![0xE9, 0x5F, 0x02, 0x00, 0x00, 0x90], }); // Hide UI stuff cam.injections.push(Injection { entry_point: 0x8B2E8C, f_orig: vec![0x41, 0x0F, 0x29, 0x9E, 0x70, 0x01, 0x00, 0x00], f_rep: vec![0x45, 0x0F, 0x29, 0x8E, 0x70, 0x01, 0x00, 0x00], }); // flashy health bar cam.injections.push(Injection { entry_point: 0x1B71453, f_orig: vec![0xC6, 0x04, 0x0B, 0x01], f_rep: vec![0xC6, 0x04, 0x0B, 0x00], }); // Nop UI coords writers cam.injections.push(Injection { entry_point: 0x1F0CB72, f_orig: vec![ 0x89, 0x05, 0x64, 0x06, 0xA1, 0x00, 0x89, 0x0D, 0x52, 0x06, 0xA1, 0x00, 0x89, 0x05, 0x68, 0x06, 0xA1, 0x00, 0x89, 0x0D, 0x5E, 0x06, 0xA1, 0x00, ], f_rep: vec![0x90; 24], }); let mut active = false; let mut capture_mouse = false; let mut restart_mouse = false; loop { if capture_mouse & restart_mouse { unsafe { SetCursorPos(INITIAL_POS, INITIAL_POS) }; restart_mouse = !restart_mouse; latest_x = INITIAL_POS; latest_y = INITIAL_POS; continue; } let start = Instant::now(); // poll rate thread::sleep(Duration::from_millis(10)); unsafe { GetCursorPos(&mut mouse_pos) }; let duration = start.elapsed().as_millis() as f32; let speed_x = ((mouse_pos.x - latest_x) as f32) / duration; let speed_y = ((mouse_pos.y - latest_y) as f32) / duration; let c_v_a = yakuza.read_value::<usize>(pause_value + 0x200, true); let controller_structure_p: usize = yakuza.read_value(p_controller + 0x200, true); let controller_state = match controller_structure_p { 0 => 0, _ => yakuza.read_value::<u64>(controller_structure_p, true), }; if active && capture_mouse { cam.update_position(speed_x, speed_y); unsafe { cam.handle_keyboard_input() }; } if active && (controller_structure_p != 0x0) { let [pos_x, pos_y, pitch, yaw] = yakuza.read_value::<[f32; 4]>(controller_structure_p + 0x10, true); // L2 & R2 check match controller_state & 0x30 { 0x20 => cam.update_fov(0.01), 0x10 => cam.update_fov(-0.01), _ => (), }; let dp_up = match controller_state & 0x9 { 0x01 => -2f32, 0x08 => 2f32, _ => 0f32, }; let speed: i8 = match controller_state & 0x3000 { 0x1000 => 1, 0x2000 => -1, _ => 0, }; let dir_speed: i8 = match controller_state & 0xC000 { 0x4000 => -1, 0x8000 => 1, _ => 0, }; let rotation: i8 = match controller_state & 0xC0 { 0x40 => 1, 0x80 => -1, 0xC0 => 2, _ => 0, }; cam.update_values(-pos_y, -pos_x, dp_up, speed, dir_speed, rotation); cam.update_position(pitch, yaw); } latest_x = mouse_pos.x; latest_y = mouse_pos.y; // to scroll infinitely restart_mouse = !restart_mouse; unsafe { if detect_activation_by_controller(controller_state) || ((GetAsyncKeyState(winuser::VK_PAUSE) as u32 & 0x8000) != 0) { active = !active; if !detect_activation_by_controller(controller_state) { capture_mouse = active; } let c_status = if active { "Deattached" } else { "Attached" }; println!("status of camera: {}", c_status); if active { cam.deattach(); remove_ui(&yakuza, true); } else { cam.attach(); remove_ui(&yakuza, false); } trigger_pause(&yakuza, c_v_a); thread::sleep(Duration::from_millis(500)); } if (GetAsyncKeyState(winuser::VK_HOME) as u32 & 0x8000) != 0 { active = !active; capture_mouse = active; let c_status = if active { "Deattached" } else { "Attached" }; println!("status of camera: {}", c_status); if active { cam.deattach(); remove_ui(&yakuza, true); } else { remove_ui(&yakuza, false); cam.attach(); } thread::sleep(Duration::from_millis(500)); } if (GetAsyncKeyState(winuser::VK_END) as u32 & 0x8000) != 0 { active = !active; capture_mouse = active; let c_status = if active { "Deattached" } else { "Attached" }; println!("status of camera: {}", c_status); if active { remove_ui(&yakuza, true); cam.deattach(); } else { remove_ui(&yakuza, false); cam.attach(); } thread::sleep(Duration::from_millis(500)); } if active & (GetAsyncKeyState(winuser::VK_DELETE) as u32 & 0x8000 != 0) { capture_mouse = !capture_mouse; let c_status = if !capture_mouse { "Deattached" } else { "Attached" }; println!("status of mouse: {}", c_status); thread::sleep(Duration::from_millis(500)); } } } }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/external.rs
common/src/external.rs
use memory_rs::external::process::Process; use nalgebra_glm as glm; use std::ffi::CString; use std::rc::Rc; use winapi; use winapi::um::winuser; const CARGO_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); const GIT_VERSION: Option<&'static str> = option_env!("GIT_VERSION"); /// Generate current version of the executable from the /// latest git version and the cargo verison. pub fn get_version() -> String { let cargo = CARGO_VERSION.unwrap_or("Unknown"); let git = GIT_VERSION.unwrap_or("Unknown"); return format!("{}.{}", cargo, git); } /// Keys that aren't contained in the VirtualKeys from the Windows API. #[repr(i32)] pub enum Keys { A = 0x41, D = 0x44, E = 0x45, Q = 0x51, S = 0x53, W = 0x57, } /// Struct that contains an entry point relative to the executable, /// the original bytes (`f_orig`) and the bytes to be injected (`f_rep`) /// pub struct Injection { /// Entry point relative to the executable pub entry_point: usize, /// Original bytes pub f_orig: Vec<u8>, /// Bytes to be injected pub f_rep: Vec<u8>, } /// Main struct that will handle the camera behaviour. pub struct Camera { process: Rc<Process>, /// Camera position in the lookAt version p_cam_x: f32, p_cam_y: f32, p_cam_z: f32, /// Camera foocus on a lookAt version f_cam_x: f32, f_cam_y: f32, f_cam_z: f32, /// Position differentials to be added according to user input. /// (Basically what will move the camera) dp_forward: f32, dp_sides: f32, dp_up: f32, speed_scale: f32, dir_speed_scale: f32, rotation: f32, /// Pointer where the injection was allocated. data_base_addr: usize, fov: f32, pub injections: Vec<Injection>, } impl Camera { pub fn new(process: Rc<Process>, data_base_addr: usize) -> Camera { Camera { process, p_cam_x: 0f32, p_cam_y: 0f32, p_cam_z: 0f32, f_cam_x: 0f32, f_cam_y: 0f32, f_cam_z: 0f32, dp_forward: 0f32, dp_sides: 0f32, dp_up: 0f32, speed_scale: 0.01, dir_speed_scale: 0.05, rotation: 0f32, data_base_addr, fov: 0f32, injections: vec![], } } /// Calculates the new lookAt using spherical coordinates. pub fn calc_new_focus_point( cam_x: f32, cam_z: f32, cam_y: f32, speed_x: f32, speed_y: f32, ) -> (f32, f32, f32) { // use spherical coordinates to add speed let theta = cam_z.atan2(cam_x) + speed_x; let phi = (cam_x.powi(2) + cam_z.powi(2)).sqrt().atan2(cam_y) + speed_y; let r = (cam_x.powi(2) + cam_y.powi(2) + cam_z.powi(2)).sqrt(); let r_cam_x = r * theta.cos() * phi.sin(); let r_cam_z = r * theta.sin() * phi.sin(); let r_cam_y = r * phi.cos(); (r_cam_x, r_cam_z, r_cam_y) } pub fn calculate_rotation(focus: glm::Vec3, pos: glm::Vec3, rotation: f32) -> [f32; 3] { let up = glm::vec3(0., 1., 0.); let m_look_at = glm::look_at(&focus, &pos, &up); let direction = { let row = m_look_at.row(2); glm::vec3(row[0], row[1], row[2]) }; // let axis = glm::vec3(0., 0., 1.); let m_new = glm::rotate_normalized_axis(&m_look_at, rotation, &direction); let result = m_new.row(1); [result[0], result[1], result[2]] } pub fn update_fov(&mut self, delta: f32) { if (delta < 0f32) & (self.fov < 0.1) { return; } if (delta > 0f32) & (self.fov > 3.13) { return; } self.fov += delta; self.process .write_value::<f32>(self.data_base_addr + 0x260, self.fov, true); } pub unsafe fn handle_keyboard_input(&mut self) { let mut dp_forward = 0f32; let mut dp_sides = 0f32; let mut dp_up = 0f32; let mut speed_scale: i8 = 0; let mut dir_speed: i8 = 0; let mut rotation: i8 = 0; /// Handle positive and negative state of keypressing macro_rules! handle_state { ([ $key_pos:expr, $key_neg:expr, $var:ident, $val:expr ]; $($tt:tt)*) => { handle_state!([$key_pos, $key_neg, $var = $val, $var = - $val]; $($tt)*); }; ([ $key_pos:expr, $key_neg:expr, $pos_do:expr, $neg_do:expr ]; $($tt:tt)*) => { if (winuser::GetAsyncKeyState($key_pos as i32) as u32 & 0x8000) != 0 { $pos_do; } if (winuser::GetAsyncKeyState($key_neg as i32) as u32 & 0x8000) != 0 { $neg_do; } handle_state!($($tt)*); }; () => {} } handle_state! { [Keys::W, Keys::S, dp_forward, 1.]; [Keys::A, Keys::D, dp_sides, 1.]; [winuser::VK_SPACE, winuser::VK_CONTROL, dp_up, 1.]; [winuser::VK_F1, winuser::VK_F2, self.update_fov(0.01), self.update_fov(-0.01)]; [winuser::VK_PRIOR, winuser::VK_NEXT, speed_scale, 1]; [winuser::VK_F4, winuser::VK_F3, dir_speed, 1]; [Keys::E, Keys::Q, rotation, 1]; } self.update_values( dp_forward, dp_sides, dp_up, speed_scale, dir_speed, rotation, ); } pub fn update_values( &mut self, dp_forward: f32, dp_sides: f32, dp_up: f32, speed_scale: i8, dir_speed_scale: i8, rotation: i8, ) { self.dp_forward = dp_forward * self.speed_scale; self.dp_sides = dp_sides * self.speed_scale; self.dp_up = dp_up * self.speed_scale; match speed_scale { 1 => { self.speed_scale += 5e-5; } -1 => { if self.speed_scale > 1e-5 { self.speed_scale -= 5e-5; } else { println!("Speed couldn't decrease"); } } _ => (), }; match dir_speed_scale { 1 => { self.dir_speed_scale += 5e-5; } -1 => { if self.dir_speed_scale > 1e-5 { self.dir_speed_scale -= 5e-5; } else { println!("Speed couldn't decrease"); } } _ => (), }; match rotation { 1 => { self.rotation -= 0.01; } -1 => { self.rotation += 0.01; } 2 => { self.rotation = 0.; } _ => (), }; } pub fn update_position(&mut self, yaw: f32, pitch: f32) { self.f_cam_x = self .process .read_value::<f32>(self.data_base_addr + 0x200, true); self.f_cam_y = self .process .read_value::<f32>(self.data_base_addr + 0x204, true); self.f_cam_z = self .process .read_value::<f32>(self.data_base_addr + 0x208, true); self.p_cam_x = self .process .read_value::<f32>(self.data_base_addr + 0x220, true); self.p_cam_y = self .process .read_value::<f32>(self.data_base_addr + 0x224, true); self.p_cam_z = self .process .read_value::<f32>(self.data_base_addr + 0x228, true); self.fov = self .process .read_value::<f32>(self.data_base_addr + 0x260, true); let r_cam_x = self.f_cam_x - self.p_cam_x; let r_cam_y = self.f_cam_y - self.p_cam_y; let r_cam_z = self.f_cam_z - self.p_cam_z; let pitch = pitch * self.dir_speed_scale; let yaw = yaw * self.dir_speed_scale; let (r_cam_x, r_cam_z, r_cam_y) = Camera::calc_new_focus_point(r_cam_x, r_cam_z, r_cam_y, yaw, pitch); let pf = glm::vec3(self.f_cam_x, self.f_cam_y, self.f_cam_z); let pp = glm::vec3(self.p_cam_x, self.p_cam_y, self.p_cam_z); let up_new = Camera::calculate_rotation(pf, pp, self.rotation); let up_v = up_new; self.f_cam_x = self.p_cam_x + r_cam_x + self.dp_forward * r_cam_x + self.dp_sides * r_cam_z; self.f_cam_z = self.p_cam_z + r_cam_z + self.dp_forward * r_cam_z - self.dp_sides * r_cam_x; self.f_cam_y = self.p_cam_y + r_cam_y + self.dp_forward * r_cam_y + self.dp_up; self.p_cam_x = self.p_cam_x + self.dp_forward * r_cam_x + self.dp_sides * r_cam_z; self.p_cam_z = self.p_cam_z + self.dp_forward * r_cam_z - self.dp_sides * r_cam_x; self.p_cam_y = self.p_cam_y + self.dp_forward * r_cam_y + self.dp_up; // flush movement self.dp_forward = 0f32; self.dp_up = 0f32; self.dp_sides = 0f32; self.process .write_value::<f32>(self.data_base_addr + 0x200, self.f_cam_x, true); self.process .write_value::<f32>(self.data_base_addr + 0x204, self.f_cam_y, true); self.process .write_value::<f32>(self.data_base_addr + 0x208, self.f_cam_z, true); self.process .write_value::<f32>(self.data_base_addr + 0x220, self.p_cam_x, true); self.process .write_value::<f32>(self.data_base_addr + 0x224, self.p_cam_y, true); self.process .write_value::<f32>(self.data_base_addr + 0x228, self.p_cam_z, true); self.process .write_value::<[f32; 3]>(self.data_base_addr + 0x240, up_v, true); } pub fn deattach(&self) { self.process .write_value::<u32>(self.data_base_addr + 0x1F0, 1, true); for injection in &self.injections { self.process .write_aob(injection.entry_point, &injection.f_rep, false); } } pub fn attach(&self) { self.process .write_value::<u32>(self.data_base_addr + 0x1F0, 0, true); for injection in &self.injections { self.process .write_aob(injection.entry_point, &injection.f_orig, false); } } } pub fn error_message(message: &str) { let title = CString::new("Error while patching").unwrap(); let message = CString::new(message).unwrap(); unsafe { winapi::um::winuser::MessageBoxA( std::ptr::null_mut(), message.as_ptr(), title.as_ptr(), 0x10, ); } } pub fn success_message(message: &str) { let title = CString::new("Patching").unwrap(); let message = CString::new(message).unwrap(); unsafe { winapi::um::winuser::MessageBoxA( std::ptr::null_mut(), message.as_ptr(), title.as_ptr(), 0x40, ); } }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/lib.rs
common/src/lib.rs
pub mod external; pub mod internal;
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/internal.rs
common/src/internal.rs
use winapi::um::xinput; const DEADZONE: i16 = 2000; const MINIMUM_ENGINE_SPEED: f32 = 1e-3; #[derive(Default, Debug)] pub struct Input { pub engine_speed: f32, // Deltas with X and Y pub delta_pos: (f32, f32), pub delta_focus: (f32, f32), pub delta_rotation: f32, pub delta_altitude: f32, pub change_active: bool, pub is_active: bool, pub fov: f32, #[cfg(debug_assertions)] pub deattach: bool, } impl Input { pub fn new() -> Input { Self { fov: 0.92, engine_speed: MINIMUM_ENGINE_SPEED, ..Input::default() } } pub fn reset(&mut self) { self.delta_pos = (0., 0.); self.delta_focus = (0., 0.); self.delta_altitude = 0.; self.change_active = false; #[cfg(debug_assertions)] { self.deattach = false; } } pub fn sanitize(&mut self) { if self.fov < 1e-3 { self.fov = 0.01; } if self.fov > 3.12 { self.fov = 3.12; } if self.engine_speed < MINIMUM_ENGINE_SPEED { self.engine_speed = MINIMUM_ENGINE_SPEED; } } } pub fn handle_controller(input: &mut Input, func: fn(u32, &mut xinput::XINPUT_STATE) -> u32) { let mut xs: xinput::XINPUT_STATE = unsafe { std::mem::zeroed() }; func(0, &mut xs); let gp = xs.Gamepad; // check camera activation if (gp.wButtons & (0x200 | 0x80)) == (0x200 | 0x80) { input.change_active = true; } #[cfg(debug_assertions)] if (gp.wButtons & (0x1000 | 0x4000)) == (0x1000 | 0x4000) { input.deattach = true; } // Update the camera changes only if it's listening if !input.is_active { return; } // modify speed if (gp.wButtons & 0x4) != 0 { input.engine_speed -= 0.01; } if (gp.wButtons & 0x8) != 0 { input.engine_speed += 0.01; } if (gp.wButtons & (0x200)) != 0 { input.delta_rotation += 0.01; } if (gp.wButtons & (0x100)) != 0 { input.delta_rotation -= 0.01; } if (gp.wButtons & (0x200 | 0x100)) == (0x200 | 0x100) { input.delta_rotation = 0.; } if gp.bLeftTrigger > 150 { input.fov -= 0.01; } if gp.bRightTrigger > 150 { input.fov += 0.01; } macro_rules! dead_zone { ($val:expr) => { if ($val < DEADZONE) && ($val > -DEADZONE) { 0 } else { $val } }; } input.delta_pos.0 = -(dead_zone!(gp.sThumbLX) as f32) / ((i16::MAX as f32) * 1e2); input.delta_pos.1 = (dead_zone!(gp.sThumbLY) as f32) / ((i16::MAX as f32) * 1e2); input.delta_focus.0 = (dead_zone!(gp.sThumbRX) as f32) / ((i16::MAX as f32) * 1e2); input.delta_focus.1 = -(dead_zone!(gp.sThumbRY) as f32) / ((i16::MAX as f32) * 1e2); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/yakuza0/build.rs
yakuza0/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/yakuza0.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/yakuza0/src/main.rs
yakuza0/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos, SetCursorPos}; const INITIAL_POS: i32 = 500; extern "C" { static get_camera_data: u8; static get_camera_data_end: u8; static get_controller_input: u8; static get_controller_input_end: u8; } fn detect_activation_by_controller(value: u64, activation: u64) -> bool { let result = value & activation; result == activation } pub fn main() -> Result<(), Error> { let mut mouse_pos: POINT = POINT::default(); // latest mouse positions let mut latest_x = 0; let mut latest_y = 0; println!("Yakuza 0 Freecam v{} by @etra0", get_version()); println!( " INSTRUCTIONS: PAUSE/L2 + X - Activate/Deactivate Free Camera END/L2 + Square - Pause the cinematic DEL - Deattach Mouse W, A, S, D/Left Stick - Move the camera Mouse/Right Stick - Point the camera CTRL, SPACE/TRIANGLE, X - Move UP or DOWN PG UP, PG DOWN/DPAD UP, DPAD DOWN - Increase/Decrease speed multiplier DPAD LEFT, DPAD RIGHT - Increase/Decrease Right Stick Sensitivity F1, F2/L2, R2 - Increase/Decrease FOV respectively Q, E/L1, R1 - Rotate the camera WARNING: Once you deattach the camera (PAUSE), your mouse will be set in a fixed position, so in order to attach/deattach the mouse to the camera, you can press DEL WARNING: If you're in freeroam and you stop hearing audio, it's probably because you have the paused option activated, simply press END to deactivate it. " ); println!("Waiting for the game to start"); let yakuza = loop { if let Ok(p) = Process::new("Yakuza0.exe") { break Rc::new(p); }; thread::sleep(Duration::from_secs(5)); }; println!("Game hooked"); let entry_point: usize = 0x18FD38; let p_shellcode = unsafe { yakuza.inject_shellcode( entry_point, 5, &get_camera_data as *const u8, &get_camera_data_end as *const u8, ) }; let p_controller = unsafe { yakuza.inject_shellcode( 0xEC1F, 6, &get_controller_input as *const u8, &get_controller_input_end as *const u8, ) }; let mut cam = Camera::new(yakuza.clone(), p_shellcode); // function that changes the focal length of the cinematics, when // active, nop this cam.injections.push(Injection { entry_point: 0x187616, f_orig: vec![0xF3, 0x0F, 0x11, 0x89, 0xAC, 0x00, 0x00, 0x00], f_rep: vec![0x90; 8], }); // WIP: Pause the cinematics of the world. let pause_cinematic_f: Vec<u8> = vec![0x41, 0x8A, 0x8E, 0xC9, 0x00, 0x00, 0x00]; let pause_cinematic_rep: Vec<u8> = vec![0xB1, 0x01, 0x90, 0x90, 0x90, 0x90, 0x90]; let pause_cinematic_offset = 0xB720DE; let mut pause_world = false; let mut active = false; let mut capture_mouse = false; let mut restart_mouse = false; loop { if capture_mouse & restart_mouse { unsafe { SetCursorPos(INITIAL_POS, INITIAL_POS) }; restart_mouse = !restart_mouse; latest_x = INITIAL_POS; latest_y = INITIAL_POS; continue; } let start = Instant::now(); // poll rate thread::sleep(Duration::from_millis(10)); unsafe { GetCursorPos(&mut mouse_pos) }; let duration = start.elapsed().as_millis() as f32; let speed_x = ((mouse_pos.x - latest_x) as f32) / duration; let speed_y = ((mouse_pos.y - latest_y) as f32) / duration; let controller_structure_p: usize = yakuza.read_value(p_controller + 0x200, true); let controller_state = match controller_structure_p { 0 => 0, _ => yakuza.read_value::<u64>(controller_structure_p, true), }; if active && capture_mouse { cam.update_position(speed_x, speed_y); unsafe { cam.handle_keyboard_input() }; } if active && (controller_structure_p != 0) { let [pos_x, pos_y, pitch, yaw] = yakuza.read_value::<[f32; 4]>(controller_structure_p + 0x10, true); // L1 & R1 check match controller_state & 0x30 { 0x20 => cam.update_fov(0.01), 0x10 => cam.update_fov(-0.01), _ => (), }; let speed: i8 = match controller_state & 0x3000 { 0x1000 => 1, 0x2000 => -1, _ => 0, }; let dp_up = match controller_state & 0x9 { 0x8 => 2f32, 0x1 => -2f32, _ => 0f32, }; let dir_speed = match controller_state & 0xC000 { 0x8000 => 1, 0x4000 => -1, _ => 0, }; let rotation: i8 = match controller_state & 0xC0 { 0x40 => 1, 0x80 => -1, 0xC0 => 2, _ => 0, }; cam.update_values(-pos_y, -pos_x, dp_up, speed, dir_speed, rotation); //dp_up, speed, dir_speed, rotation); cam.update_position(pitch, yaw); } latest_x = mouse_pos.x; latest_y = mouse_pos.y; // to scroll infinitely restart_mouse = !restart_mouse; unsafe { if detect_activation_by_controller(controller_state, 0x11) || (GetAsyncKeyState(winuser::VK_PAUSE) as u32 & 0x8000) != 0 { active = !active; if controller_state & 0x11 != 0x11 { capture_mouse = active; } let c_status = if active { "Deattached" } else { "Attached" }; println!("status of camera: {}", c_status); if active { cam.deattach(); } else { cam.attach(); } thread::sleep(Duration::from_millis(500)); } if active & (GetAsyncKeyState(winuser::VK_DELETE) as u32 & 0x8000 != 0) { capture_mouse = !capture_mouse; let c_status = if !capture_mouse { "Deattached" } else { "Attached" }; println!("status of mouse: {}", c_status); thread::sleep(Duration::from_millis(500)); } if detect_activation_by_controller(controller_state, 0x14) || (GetAsyncKeyState(winuser::VK_END) as u32 & 0x8000) != 0 { pause_world = !pause_world; println!("status of pausing: {}", pause_world); if pause_world { yakuza.write_aob(pause_cinematic_offset, &pause_cinematic_rep, false); } else { yakuza.write_aob(pause_cinematic_offset, &pause_cinematic_f, false); } thread::sleep(Duration::from_millis(500)); } } } }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/injector/build.rs
likeadragon/injector/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../../assets/likeadragon.ico") .set("InternalName", "likeadragon-freecam"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/injector/src/main.rs
likeadragon/injector/src/main.rs
use memory_rs::external::process::Process; use simple_injector::inject_dll; use std::env::current_exe; fn main() { println!("Waiting for the process to start"); let p = loop { if let Ok(p) = Process::new("YakuzaLikeADragon.exe") { break p; } std::thread::sleep(std::time::Duration::from_secs(5)); }; println!("Game found"); let mut path = current_exe().unwrap(); path.pop(); let path_string = path.to_string_lossy(); let dll_path = format!("{}/likeadragon.dll", path_string).to_string(); inject_dll(&p, &dll_path); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/build.rs
likeadragon/lib/build.rs
extern crate winres; fn main() { let res = winres::WindowsResource::new(); println!("cargo:rerun-if-changed=interceptor.asm"); println!("cargo:rustc-env=CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,avx"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/src/lib.rs
likeadragon/lib/src/lib.rs
#![allow(clippy::clippy::missing_safety_doc)] pub mod globals; use crate::globals::*; use anyhow::{Context, Result}; use common::external::{error_message, Camera}; use common::internal::{handle_controller, Input}; use memory_rs::internal::injections::*; use memory_rs::internal::memory::{resolve_module_path}; use memory_rs::internal::process_info::ProcessInfo; use memory_rs::{generate_aob_pattern, try_winapi}; use std::io::prelude::*; use std::sync::atomic::Ordering; use winapi::shared::minwindef::LPVOID; use winapi::um::winuser::{self, GetAsyncKeyState}; use winapi::um::xinput; use nalgebra_glm as glm; use log::{error, info}; use simplelog::*; /// Structure parsed from the game. #[repr(C)] struct GameCamera { pos: [f32; 4], focus: [f32; 4], rot: [f32; 4], /// We simply skip 8 values because we don't know what they are. padding_: [f32; 0x8], fov: f32, } impl GameCamera { pub fn consume_input(&mut self, input: &Input) { let r_cam_x = self.focus[0] - self.pos[0]; let r_cam_y = self.focus[1] - self.pos[1]; let r_cam_z = self.focus[2] - self.pos[2]; let (r_cam_x, r_cam_z, r_cam_y) = Camera::calc_new_focus_point( r_cam_x, r_cam_z, r_cam_y, input.delta_focus.0, input.delta_focus.1, ); self.pos[0] += r_cam_x * input.delta_pos.1 + input.delta_pos.0 * r_cam_z; self.pos[1] += r_cam_y * input.delta_pos.1; self.pos[2] += r_cam_z * input.delta_pos.1 - input.delta_pos.0 * r_cam_x; self.focus[0] = self.pos[0] + r_cam_x; self.focus[1] = self.pos[1] + r_cam_y; self.focus[2] = self.pos[2] + r_cam_z; let focus_ = glm::vec3(self.focus[0], self.focus[1], self.focus[2]); let pos_ = glm::vec3(self.pos[0], self.pos[1], self.pos[2]); let result = Camera::calculate_rotation(focus_, pos_, input.delta_rotation); self.rot[0] = result[0]; self.rot[1] = result[1]; self.rot[2] = result[2]; self.fov = input.fov; } } impl std::fmt::Debug for GameCamera { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let ptr = self as *const GameCamera as usize; f.debug_struct("GameCamera") .field("self", &format_args!("{:x}", ptr)) .field("pos", &self.pos) .field("focus", &self.focus) .field("rot", &self.rot) .field("fov", &self.fov) .finish() } } pub unsafe extern "system" fn wrapper(lib: LPVOID) -> u32 { // Logging initialization { let mut path = resolve_module_path(lib as _).unwrap(); path.push("ylad.log"); CombinedLogger::init(vec![ TermLogger::new( log::LevelFilter::Info, Config::default(), TerminalMode::Mixed, ), WriteLogger::new( log::LevelFilter::Info, Config::default(), std::fs::File::create(path).unwrap(), ), ]) .unwrap(); match patch(lib) { Ok(_) => { info!("Everything executed perfectly"); } Err(e) => { let msg = format!("{}", e); error!("Error: {}", msg); { use winapi::um::wincon::FreeConsole; (FreeConsole()); } error_message(&msg); } }; info!("Exiting"); } winapi::um::libloaderapi::FreeLibraryAndExitThread( lib as winapi::shared::minwindef::HMODULE, 0, ); 0 } /// `use_xinput_from_game` is in charge to check if the pointer /// `controller_input_function` is already setted. If the pointer is different /// from zero, it will actually use the function, if it doesn't, will return /// an empty `XINPUT_STATE` struct. pub fn use_xinput_from_game(index: u32, xs: &mut xinput::XINPUT_STATE) -> u32 { let xstate: xinput::XINPUT_STATE = unsafe { std::mem::zeroed() }; let function_pointer = controller_input_function.load(Ordering::Relaxed); if function_pointer == 0 { unsafe { std::ptr::copy_nonoverlapping(&xstate, xs, 1) }; return 0; } let func: fn(u32, &mut xinput::XINPUT_STATE) -> u32 = unsafe { std::mem::transmute(function_pointer as *const u8) }; func(index, xs) } /// This function will be injected in the game, with the purpose of overriding /// the input getter. This function will use `use_xinput_from_game` to get /// the input. It'll also check if the camera is active, in the case it is, /// it will block all input except the pause button because when you alt-tab /// in the game, the game will pause. #[no_mangle] pub unsafe extern "system" fn xinput_interceptor(index: u32, xs: &mut xinput::XINPUT_STATE) -> u32 { let result = use_xinput_from_game(index, xs); if g_camera_active == 0 { return result; } // check if the pause button was pressed let buttons = (*xs).Gamepad.wButtons & 0x10; let mut gamepad: xinput::XINPUT_GAMEPAD = std::mem::zeroed(); gamepad.wButtons = buttons; if g_camera_active == 1 { std::ptr::copy_nonoverlapping(&gamepad, &mut (*xs).Gamepad, 1); } result } /// In charge of doing all the `Detour` injections type. fn inject_detourings(proc_inf: &ProcessInfo) -> Result<Vec<Detour>> { macro_rules! auto_cast { ($val:expr) => { &$val as *const u8 as usize }; }; let mut detours = vec![]; unsafe { // ---- Camera func ---- let pat = generate_aob_pattern![ 0x90, 0xC5, 0xF8, 0x10, 0x07, 0xC5, 0xF8, 0x11, 0x86, 0x80, 0x00, 0x00, 0x00 ]; let camera_func = Detour::new_from_aob( pat, &proc_inf.region, auto_cast!(asm_get_camera_data), Some(&mut g_get_camera_data), 15, Some(-0x33) ).with_context(|| "camera_func failed")?; info!("camera_func found: {:x}", camera_func.entry_point); detours.push(camera_func); // ---- // ---- Timestop ---- let pat = generate_aob_pattern![ 0xC4, 0xE1, 0xFA, 0x2C, 0xC0, 0x89, 0x05, _, _, _, _, 0xC5, 0x7A, 0x11, 0x05, _, _, _, _ ]; let timestop_ptr = proc_inf.region.scan_aob(&pat)?.with_context(|| "timestop issues")? + 0xB; g_get_timestop_rip = timestop_ptr; g_get_timestop_first_offset = *((timestop_ptr + 0x4) as *const u32) as usize; info!( "_get_timestop_first_offset: {:x}", g_get_timestop_first_offset ); let timestop_func = Detour::new( timestop_ptr, 16, auto_cast!(asm_get_timestop), Some(&mut g_get_timestop), ); info!("timestop_func found: {:x}", timestop_func.entry_point); detours.push(timestop_func); // ---- // ---- Controller handler let pat = generate_aob_pattern![ 0xE8, _, _, _, _, 0x85, 0xC0, 0x0F, 0x85, _, _, _, _, 0x48, 0x8B, 0x44, 0x24, 0x26, 0x48, 0x8B, 0x8C, 0x24, 0xD0, 0x00, 0x00, 0x00 ]; let controller_blocker = Detour::new_from_aob( pat, &proc_inf.region, auto_cast!(asm_get_controller), Some(&mut g_get_controller), 15, Some(-0x8), )?; let controller_blocker_rip = controller_blocker.entry_point + 0x8; let controller_blocker_offset = *((controller_blocker_rip + 0x1) as *const u32) as usize; let function_pointer = controller_blocker_rip + controller_blocker_offset; controller_input_function.store(function_pointer, Ordering::Relaxed); info!( "controller_blocker found: {:x}", controller_blocker.entry_point ); detours.push(controller_blocker); } detours.iter_mut().inject(); info!("injections completed succesfully"); Ok(detours) } /// In charge of making all the `Injection` type of injections. fn make_injections(proc_inf: &ProcessInfo) -> Result<Vec<Injection>> { let mut v = vec![]; let fov = Injection::new_from_aob( &proc_inf.region, vec![0x90; 6], generate_aob_pattern![ 0x89, 0x86, 0xD0, 0x00, 0x00, 0x00, 0x8B, 0x47, 0x54, 0x89, 0x86, 0xD4, 0x00, 0x00, 0x00 ], ) .with_context(|| "FoV couldn't be found")?; info!("FoV was found at {:x}", fov.entry_point); v.push(fov); let no_ui = Injection::new_from_aob( &proc_inf.region, vec![0xC3], generate_aob_pattern![ 0x40, 0x55, 0x48, 0x83, 0xEC, 0x20, 0x80, 0xBA, 0xD4, 0x01, 0x00, 0x00, 0x00, 0x48, 0x8B, 0xEA, 0x0F, 0x84, _, _, _, _ ], ) .with_context(|| "no_ui couldn't be found")?; info!("no_ui was found at {:x}", no_ui.entry_point); v.push(no_ui); Ok(v) } fn write_ui_elements(proc_inf: &ProcessInfo) -> Result<Vec<StaticElement>> { let pat = generate_aob_pattern![ 0xC5, 0xE8, 0x57, 0xD2, 0xC5, 0xF8, 0x57, 0xC0, 0x48, 0x8D, 0x54, 0x24, 0x20, 0xC5, 0xB0, 0x58, 0x08 ]; let ptr = proc_inf.region.scan_aob(&pat)? .context("Couldn't find UI values")? + 0x11; let offset = (ptr + 0x2) as *const u32; let offset = unsafe { *offset }; let rip = ptr + 0x6; let base_addr_for_static_numbers = rip + (offset as usize); info!( "base_addr_for_static_numbers: {:x}", base_addr_for_static_numbers ); Ok(vec![ StaticElement::new(base_addr_for_static_numbers), StaticElement::new(base_addr_for_static_numbers + 0x4), StaticElement::new(base_addr_for_static_numbers + 0x24), ]) } #[allow(unreachable_code)] fn patch(_: LPVOID) -> Result<()> { #[cfg(feature = "non_automatic")] common::external::success_message("The injection was made succesfully"); #[cfg(debug_assertions)] unsafe { use winapi::um::consoleapi::AllocConsole; try_winapi!(AllocConsole()); } info!( "Yakuza Like A Dragon freecam v{} by @etra0", common::external::get_version() ); let proc_inf = ProcessInfo::new(None)?; info!("{:x?}", proc_inf); let mut active = false; let mut detours = inject_detourings(&proc_inf)?; let mut ui_elements: Vec<StaticElement> = write_ui_elements(&proc_inf)?; let mut injections = make_injections(&proc_inf)?; let mut input = Input::new(); info!("Starting main loop"); loop { handle_controller(&mut input, use_xinput_from_game); input.sanitize(); #[cfg(debug_assertions)] if input.deattach || (unsafe { GetAsyncKeyState(winuser::VK_HOME) } as u32 & 0x8000) != 0 { break; } input.is_active = active; if input.change_active { active = !active; unsafe { g_camera_active = active as u8; } info!("Camera is {}", active); input.engine_speed = 1e-3; if active { injections.iter_mut().inject(); } else { ui_elements.iter_mut().remove_injection(); injections.iter_mut().remove_injection(); // We need to set g_camera_struct to 0 since // the camera struct can change depending on the scene. unsafe { g_camera_struct = 0; } } input.change_active = false; std::thread::sleep(std::time::Duration::from_millis(500)); } unsafe { if (g_camera_struct == 0x0) || !active { continue; } } let gc = unsafe { (g_camera_struct + 0x80) as *mut GameCamera }; unsafe { g_engine_speed = input.engine_speed; } ui_elements.iter_mut().inject(); unsafe { (*gc).consume_input(&input); println!("{:?}", input); } input.reset(); std::thread::sleep(std::time::Duration::from_millis(10)); } std::io::stdout().flush()?; info!("Dropping values"); detours.clear(); std::thread::sleep(std::time::Duration::from_secs(2)); #[cfg(debug_assertions)] unsafe { info!("Freeing console"); use winapi::um::wincon::FreeConsole; try_winapi!(FreeConsole()); } info!("Exiting library"); Ok(()) } memory_rs::main_dll!(wrapper);
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/src/globals.rs
likeadragon/lib/src/globals.rs
#![allow(non_upper_case_globals)] use memory_rs::scoped_no_mangle; use std::sync::atomic::AtomicUsize; scoped_no_mangle! { // Pointer to the camera struct (the lookat is at +0x80 offset g_camera_struct: usize = 0; // Boolean that says if the camera is active g_camera_active: u8 = 0x0; // Address to jmp back after the injection g_get_camera_data: usize = 0x0; g_get_timestop: usize = 0x0; g_get_timestop_rip: usize = 0x0; g_get_timestop_first_offset: usize = 0x0; g_get_controller: usize = 0x0; // Global engine speed to be written by the main dll g_engine_speed: f32 = 1.; } /// This pointer will contain the function that either steam or /// ms store version uses, since steam overrides the xinput in order /// to be able to use more controller options. pub static controller_input_function: AtomicUsize = AtomicUsize::new(0); extern "C" { pub static asm_get_camera_data: u8; pub static asm_get_timestop: u8; pub static asm_get_controller: u8; }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/lib.rs
src/lib.rs
// Behind the feature gates #![cfg_attr(feature = "hw", feature(stdsimd))] #![cfg_attr(feature = "hw", feature(llvm_asm))] // FIXME: Baking still #![allow(dead_code)] #![allow(unused_imports)] // #![feature(core_intrinsics)] // #![feature(get_mut_unchecked)] //! //! Lever is a library for writing transactional systems (esp. for in-memory data). It consists of various parts: //! //! * `index`: Indexes and lookup structures //! * `stats`: Statistics structures //! * `sync`: Synchronization primitives for transactional systems //! * `table`: Various KV table kinds backed by transactional algorithms //! * `txn`: Transactional primitives and management //! //! Lever is using MVCC model to manage concurrency. It supplies building blocks for in-memory data stores for //! transactional endpoints, databases and systems. Unblocked execution path is main aim for lever while //! not sacrificing failover mechanisms. //! //! Lever provides STM, lock-free, wait-free synchronization primitives and various other tools to facilitate writing //! transactional in-memory systems. #![doc( html_logo_url = "https://raw.githubusercontent.com/vertexclique/lever/master/img/lever-square.png" )] /// Indexes and lookup structures pub mod index; /// Statistics related structures pub mod stats; /// Synchronization primitives pub mod sync; /// Transactional in-memory table variations pub mod table; /// Transactional primitives and transaction management pub mod txn; /// Allocation helpers mod alloc; /// Hardware transactional memory mod htm; use std::hash::Hash; use std::sync::Arc; /// /// Prelude of lever pub mod prelude { pub use crate::sync::prelude::*; pub use crate::table::prelude::*; pub use crate::txn::prelude::*; } use crate::table::lotable::LOTable; use crate::txn::transact::TxnManager; use anyhow::*; /// /// Main management struct for transaction management. /// /// Once get built it can be passed around with simple clone. /// /// All rules of compute heavy workloads and their limitations apply to Lever's transaction /// system. #[derive(Clone)] pub struct Lever(Arc<TxnManager>); /// /// Instantiate lever instance pub fn lever() -> Lever { Lever(TxnManager::manager()) } impl Lever { /// /// Builder method for transactional optimistic, repeatable read in-memory table. pub fn new_lotable<K, V>(&self) -> LOTable<K, V> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync + Ord, V: 'static + Clone + Send + Sync, { LOTable::new() } /// /// Get global transaction manager pub fn manager(&self) -> Arc<TxnManager> { self.0.clone() } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/index/zonemap.rs
src/index/zonemap.rs
use crate::stats::bitonics::CountingBitonic; use crate::table::lotable::LOTable; use anyhow::*; use itertools::Itertools; use slice_group_by::GroupBy; use std::any::Any; use std::borrow::{Borrow, Cow}; use std::ops::{Deref, Range, RangeBounds}; use std::sync::Arc; /// /// Represents single zone definition for the selectivity #[derive(Default, Clone, Debug)] pub struct Zone { pub min: usize, pub max: usize, pub selectivity: usize, pub stats: CountingBitonic, } unsafe impl Send for Zone {} unsafe impl Sync for Zone {} impl Zone { /// Get selectivity hit count for the zone pub fn hits(&self) -> usize { self.stats.get() } /// /// Return zone triple of (min, max, selectivity) pub fn zone_triple(&self) -> (usize, usize, usize) { (self.min, self.max, self.selectivity) } } impl From<(usize, usize)> for Zone { fn from(r: (usize, usize)) -> Self { Zone { min: r.0, max: r.1, ..Self::default() } } } impl From<(usize, usize, usize)> for Zone { fn from(r: (usize, usize, usize)) -> Self { Zone { min: r.0, max: r.1, selectivity: r.2, ..Self::default() } } } /// /// Represents a zone data for a column #[derive(Debug, Clone)] pub struct ColumnZoneData { /// Zone map built in zones: LOTable<usize, Zone>, } unsafe impl Send for ColumnZoneData {} unsafe impl Sync for ColumnZoneData {} impl ColumnZoneData { /// /// Create new column zone data pub fn new() -> ColumnZoneData { Self { zones: LOTable::new(), } } /// /// Insert given zone data with given zone id into the column zone data /// Returns old zone data if zone data exists pub fn insert(&self, zone_id: usize, zone_data: Zone) -> Result<Arc<Option<Zone>>> { self.zones.insert(zone_id, zone_data) } /// /// Inserts given zone dataset into this column zone data pub fn batch_insert(&self, zones: Vec<(usize, Zone)>) { zones.iter().for_each(|(zid, zdata)| { let _ = self.zones.insert(*zid, zdata.clone()); }) } /// /// Update given zone id with given selectivity data pub fn update(&self, zone_id: usize, min: usize, max: usize, selectivity: usize) { let zone = Zone { min, max, selectivity, ..Default::default() }; let _ = self.zones.insert(zone_id, zone); } /// /// Update given zone id with given zone data pub fn update_zone(&self, zone_id: usize, zone_data: Zone) { let _ = self.zones.insert(zone_id, zone_data); } /// /// Get selectivity for the given zone id pub fn selectivity(&self, zone_id: usize) -> usize { self.zones .replace_with(&zone_id, |z| { z.map_or(Some(Zone::default()), |z| { z.stats.traverse(zone_id); Some(z.to_owned()) }) }) .map_or(0, |z| z.selectivity) } /// /// Returns selectivity in question, queried by the range pub fn selectivity_range<R>(&self, range_min: R, range_max: R, data: &[R]) -> usize where R: PartialOrd + std::fmt::Debug, { self.zones .values() .into_iter() .filter(|z| { let (zl, zr, _) = z.zone_triple(); (&data[zl]..=&data[zr]).contains(&&range_min) || (&data[zl]..=&data[zr]).contains(&&range_max) }) .map(|z| z.selectivity) .sum() } /// /// Returns scan range in question, queried by the constraint range pub fn scan_range<R>(&self, range_min: R, range_max: R, data: &[R]) -> (usize, usize) where R: PartialOrd, { self.zones .values() .into_iter() .filter(|z| { let (zl, zr, _) = z.zone_triple(); (&data[zl]..=&data[zr]).contains(&&range_min) || (&data[zl]..=&data[zr]).contains(&&range_max) }) .fold((usize::MAX, 0_usize), |mut acc, e| { acc.0 = acc.0.min(e.min); acc.1 = acc.1.max(e.max); acc }) } /// Get zone selectivity hits for the given zone id pub fn zone_hits(&self, zone_id: usize) -> usize { self.zones.get(&zone_id).map_or(0, |z| z.hits()) } } /// /// Represents a zone map for a table #[derive(Debug, Clone)] pub struct ZoneMap { col_zones: LOTable<String, ColumnZoneData>, } impl ZoneMap { /// /// Create new zone map pub fn new() -> ZoneMap { Self { col_zones: LOTable::new(), } } /// /// Insert given column zone data with given zone id into the column zone map /// Returns old column zone data if column zone data exists pub fn insert<T>( &self, column: T, zone_data: ColumnZoneData, ) -> Result<Arc<Option<ColumnZoneData>>> where T: Into<String>, { self.col_zones.insert(column.into(), zone_data) } /// /// Returns selectivity in question, queried by the range pub fn selectivity_range<C, R>( &self, column: C, range_min: R, range_max: R, data: &[R], ) -> usize where C: Into<String>, R: PartialOrd + std::fmt::Debug, { self.col_zones .get(&column.into()) .map_or(0_usize, |c| c.selectivity_range(range_min, range_max, data)) } /// /// Returns scan range in question, queried by the constraint range pub fn scan_range<C, R>( &self, column: C, range_min: R, range_max: R, data: &[R], ) -> (usize, usize) where C: Into<String>, R: PartialOrd + std::fmt::Debug, { self.col_zones .get(&column.into()) .map_or((0, 0), |c| c.scan_range(range_min, range_max, data)) } } impl<'a, T, R> From<Vec<(T, &'a [R])>> for ZoneMap where T: Into<String>, R: PartialOrd, { fn from(data: Vec<(T, &'a [R])>) -> Self { let zm = ZoneMap::new(); data.into_iter().for_each(|(col, d)| { let mut row_id = 0_usize; let czm = ColumnZoneData::new(); d.linear_group_by(|l, r| l < r).for_each(|d| { let r = d.len(); let offset = row_id; let z = Zone::from((row_id, row_id + r - 1, r)); row_id += r; let _ = czm.insert(offset, z); }); let _ = zm.insert(col.into(), czm); }); zm } } #[cfg(test)] mod tests_zone_map { use super::*; #[test] fn test_zone_selectivity() { let customers: Vec<i32> = vec![vec![1, 0, -1, -2].repeat(2), vec![1, 2, 3, 4].repeat(3)].concat(); let products = vec![4, 3, 2, 1].repeat(100); let payouts = vec![4, 2, 6, 7].repeat(100); let ingestion_data = vec![ ("customers", customers.as_slice()), ("products", products.as_slice()), ("payouts", payouts.as_slice()), ]; let zone_map = ZoneMap::from(ingestion_data); // Selectivity range is: [-2, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4] assert_eq!( zone_map.selectivity_range("customers", 4, 4, &*customers), 13 ); } #[test] fn test_zone_scan_range() { let customers: Vec<i32> = vec![vec![1, 0, -1, -2].repeat(2), vec![1, 2, 3, 4].repeat(3)].concat(); let products = vec![4, 3, 2, 1].repeat(100); let payouts = vec![4, 2, 6, 7].repeat(100); let ingestion_data = vec![ ("customers", customers.as_slice()), ("products", products.as_slice()), ("payouts", payouts.as_slice()), ]; let zone_map = ZoneMap::from(ingestion_data); // Selectivity range is: [-2, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4] // Scan range is: [7, 19] assert_eq!(zone_map.scan_range("customers", 4, 4, &*customers), (7, 19)); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/index/mod.rs
src/index/mod.rs
/// Zone map implementation pub mod zonemap;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/stats/bitonics.rs
src/stats/bitonics.rs
use std::sync::{ atomic::{self, AtomicBool, AtomicU8, AtomicUsize, Ordering}, Arc, }; #[derive(Clone, Debug)] struct Balancer { toggle: Arc<AtomicBool>, } impl Balancer { pub fn new() -> Balancer { Balancer { toggle: Arc::new(AtomicBool::new(true)), } } /// Returns output wire based on the switch pub fn traverse(&self) -> usize { // TODO: refactor let res = self.toggle.load(Ordering::SeqCst); self.toggle.store(!res, Ordering::SeqCst); if res { 0_usize } else { 1_usize } } } unsafe impl Send for Balancer {} unsafe impl Sync for Balancer {} #[derive(Clone, Debug)] struct BalancingMerger { halves: Vec<BalancingMerger>, layer: Vec<Balancer>, width: usize, } impl BalancingMerger { pub fn new(width: usize) -> BalancingMerger { let layer = (0..width / 2) .into_iter() .map(|_| Balancer::new()) .collect::<Vec<Balancer>>(); let halves = if width > 2 { vec![ BalancingMerger::new(width / 2), BalancingMerger::new(width / 2), ] } else { vec![] }; BalancingMerger { halves, layer, width, } } /// Traverses edges for the mergers pub fn traverse(&self, input: usize) -> usize { let output = if self.width > 2 { self.halves[input % 2].traverse(input / 2) } else { 0 }; output + self.layer[output].traverse() } } unsafe impl Send for BalancingMerger {} unsafe impl Sync for BalancingMerger {} /// Balancing bitonic network #[derive(Clone, Debug)] pub struct BalancingBitonic { halves: Vec<BalancingBitonic>, merger: BalancingMerger, width: usize, } impl BalancingBitonic { pub fn new(width: usize) -> BalancingBitonic { assert_eq!(width % 2, 0, "Wires should be multiple of two."); let halves = if width > 2 { vec![ BalancingBitonic::new(width / 2), BalancingBitonic::new(width / 2), ] } else { vec![] }; BalancingBitonic { halves, merger: BalancingMerger::new(width), width, } } pub fn traverse(&self, input: usize) -> usize { let output = if self.width > 2 { self.halves[input % 2].traverse(input / 2) } else { 0 }; output + self.merger.traverse(output) } } unsafe impl Send for BalancingBitonic {} unsafe impl Sync for BalancingBitonic {} /// Counting bitonic network #[derive(Clone, Debug)] pub struct CountingBitonic { /// Underlying balancing bitonic implementation balancing: BalancingBitonic, /// Represents current wire traversal counter value state: Arc<AtomicUsize>, /// Represents full wire trips trips: Arc<AtomicUsize>, /// Width of the bitonic network width: usize, } impl CountingBitonic { /// /// Create new counting bitonic network. pub fn new(width: usize) -> CountingBitonic { CountingBitonic { balancing: BalancingBitonic::new(width), state: Arc::new(AtomicUsize::default()), trips: Arc::new(AtomicUsize::default()), width, } } /// Traverse data through the counting bitonic. pub fn traverse(&self, input: usize) -> usize { let wire = self.balancing.traverse(input); let trips = self.trips.fetch_add(1, Ordering::AcqRel) + 1; let (q, r) = (trips / self.width, trips % self.width); if r > 0 { self.state.fetch_add(wire, Ordering::AcqRel) } else { wire.checked_sub(q).map_or_else( || self.state.fetch_add(wire, Ordering::AcqRel), |e| self.state.fetch_add(e, Ordering::AcqRel), ) } } /// Get inner state for the counting bitonic pub fn get(&self) -> usize { self.state.load(Ordering::Acquire) } // TODO: min max here? } unsafe impl Send for CountingBitonic {} unsafe impl Sync for CountingBitonic {} impl Default for CountingBitonic { fn default() -> Self { CountingBitonic::new(8) } } #[cfg(test)] mod test_bitonics { use super::*; #[test] fn test_balancing_bitonic_traversal() { let data: Vec<Vec<usize>> = vec![ vec![9, 3, 1], vec![5, 4], vec![11, 23, 4, 10], vec![30, 40, 2], ]; let bitonic = BalancingBitonic::new(4); let wires = data .iter() .flatten() .map(|d| bitonic.traverse(*d)) .collect::<Vec<usize>>(); assert_eq!(&*wires, [0, 2, 1, 3, 0, 1, 2, 3, 0, 2, 1, 3]) // 0: 9, 4, 10, // 1: 1, 11, 40, // 2: 3, 23, 30, // 3: 5, 4, 2 } #[test] fn test_counting_bitonic_traversal() { let data: Vec<Vec<usize>> = vec![ vec![9, 3, 1], vec![5, 4], vec![11, 23, 4, 10], vec![30, 40, 2], ]; let bitonic = CountingBitonic::new(4); let wires = data .iter() .flatten() .map(|d| bitonic.traverse(*d)) .collect::<Vec<usize>>(); assert_eq!(&*wires, [0, 0, 2, 3, 5, 5, 6, 8, 9, 9, 11, 12]) } #[test] fn test_counting_bitonic_traversal_and_get() { let data: Vec<Vec<usize>> = vec![ vec![9, 3, 1], vec![5, 4], vec![11, 23, 4, 10], vec![30, 40, 2], ]; let bitonic = CountingBitonic::new(4); let wires = data .iter() .flatten() .map(|d| bitonic.traverse(*d)) .collect::<Vec<usize>>(); assert_eq!(&*wires, [0, 0, 2, 3, 5, 5, 6, 8, 9, 9, 11, 12]); assert_eq!(bitonic.get(), 12); } #[test] fn test_balancing_bitonic_mt_traversal() { (0..10_000).into_iter().for_each(|_| { let bitonic = Arc::new(BalancingBitonic::new(4)); let data1: Vec<usize> = vec![9, 3, 1]; let bitonic1 = bitonic.clone(); let bdata1 = std::thread::spawn(move || { data1 .iter() .map(|d| bitonic1.traverse(*d)) .collect::<Vec<usize>>() }); let data2: Vec<usize> = vec![5, 4]; let bitonic2 = bitonic.clone(); let bdata2 = std::thread::spawn(move || { data2 .iter() .map(|d| bitonic2.traverse(*d)) .collect::<Vec<usize>>() }); let data3: Vec<usize> = vec![11, 23, 4, 10]; let bitonic3 = bitonic.clone(); let bdata3 = std::thread::spawn(move || { data3 .iter() .map(|d| bitonic3.traverse(*d)) .collect::<Vec<usize>>() }); let data4: Vec<usize> = vec![30, 40, 2]; let bitonic4 = bitonic.clone(); let bdata4 = std::thread::spawn(move || { data4 .iter() .map(|d| bitonic4.traverse(*d)) .collect::<Vec<usize>>() }); let (bdata1, bdata2, bdata3, bdata4) = ( bdata1.join().unwrap(), bdata2.join().unwrap(), bdata3.join().unwrap(), bdata4.join().unwrap(), ); let res: Vec<usize> = [bdata1, bdata2, bdata3, bdata4].concat(); assert!(res.iter().count() == 12); }); } #[test] fn test_counting_bitonic_mt_traversal() { (0..10_000).into_iter().for_each(|_| { let bitonic = Arc::new(CountingBitonic::new(4)); let data1: Vec<usize> = vec![9, 3, 1]; let bitonic1 = bitonic.clone(); let bdata1 = std::thread::spawn(move || { data1 .iter() .map(|d| bitonic1.traverse(*d)) .collect::<Vec<usize>>() }); let data2: Vec<usize> = vec![5, 4]; let bitonic2 = bitonic.clone(); let bdata2 = std::thread::spawn(move || { data2 .iter() .map(|d| bitonic2.traverse(*d)) .collect::<Vec<usize>>() }); let data3: Vec<usize> = vec![11, 23, 4, 10]; let bitonic3 = bitonic.clone(); let bdata3 = std::thread::spawn(move || { data3 .iter() .map(|d| bitonic3.traverse(*d)) .collect::<Vec<usize>>() }); let data4: Vec<usize> = vec![30, 40, 2]; let bitonic4 = bitonic.clone(); let bdata4 = std::thread::spawn(move || { data4 .iter() .map(|d| bitonic4.traverse(*d)) .collect::<Vec<usize>>() }); let (bdata1, bdata2, bdata3, bdata4) = ( bdata1.join().unwrap(), bdata2.join().unwrap(), bdata3.join().unwrap(), bdata4.join().unwrap(), ); let res: Vec<usize> = [bdata1, bdata2, bdata3, bdata4].concat(); assert!(res.iter().count() == 12); assert!(res.iter().find(|&e| *e >= 12 / 2).is_some()) }); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/stats/mod.rs
src/stats/mod.rs
/// Bitonic network implementations pub mod bitonics;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/x86_64.rs
src/htm/x86_64.rs
use super::ops::*; #[cfg(target_arch = "x86")] use std::arch::x86::{ _xabort, _xabort_code, _xbegin, _xend, _xtest, _XABORT_CAPACITY, _XABORT_CONFLICT, _XABORT_DEBUG, _XABORT_EXPLICIT, _XABORT_RETRY, _XBEGIN_STARTED, }; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::{ _xabort, _xabort_code, _xbegin, _xend, _xtest, _XABORT_CAPACITY, _XABORT_CONFLICT, _XABORT_DEBUG, _XABORT_EXPLICIT, _XABORT_RETRY, _XBEGIN_STARTED, }; /// Return code from _xbegin() #[derive(Debug)] pub struct HwTxBeginCode(u32); impl HwTxBeginCode { #[inline] pub fn started(&self) -> bool { self.0 == _XBEGIN_STARTED } #[inline] pub fn abort(&self) -> bool { self.0 & _XABORT_EXPLICIT != 0 && !self.started() } #[inline] pub fn retry(&self) -> bool { self.0 & _XABORT_RETRY != 0 && !self.started() } #[inline] pub fn conflict(&self) -> bool { self.0 & _XABORT_CONFLICT != 0 && !self.started() } #[inline] pub fn capacity(&self) -> bool { self.0 & _XABORT_CAPACITY != 0 && !self.started() } #[inline] pub fn debug(&self) -> bool { self.0 & _XABORT_DEBUG != 0 && !self.started() } } /// most significant 8 bits #[derive(Copy, Clone)] pub enum HwTxAbortCode { Overhaul = 1 << 0, UserlandAbort = 1 << 1, } impl PartialEq for HwTxAbortCode { fn eq(&self, other: &HwTxAbortCode) -> bool { *self as u32 == _xabort_code(*other as u32) } } /// Return code from _xtest() pub struct HwTxTestCode(u8); impl HwTxTestCode { #[inline] pub fn in_txn(&self) -> bool { self.0 != 0 } #[inline] pub fn depth(&self) -> usize { self.0 as usize } } pub struct HTM(); impl HTM { const OVERHAUL: u32 = HwTxAbortCode::Overhaul as u32; const USERLAND_ABORT: u32 = HwTxAbortCode::UserlandAbort as u32; } impl Ops for HTM { fn begin(&self) -> HwTxBeginCode { unsafe { HwTxBeginCode(_xbegin()) } } fn abort(&self, reason_code: &HwTxAbortCode) -> ! { unsafe { match reason_code { HwTxAbortCode::Overhaul => _xabort(HTM::OVERHAUL), HwTxAbortCode::UserlandAbort => _xabort(HTM::USERLAND_ABORT), } std::hint::unreachable_unchecked() } } fn test(&self) -> HwTxTestCode { unsafe { HwTxTestCode(_xtest()) } } fn commit(&self) { unsafe { _xend() } } fn cpu_support(&self) -> bool { std::is_x86_feature_detected!("rtm") } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/mod.rs
src/htm/mod.rs
#[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), feature = "hw"))] mod x86_64; #[cfg(all(target_arch = "aarch64", feature = "hw"))] mod aarch64; /// Architecture operations #[cfg(feature = "hw")] pub mod ops;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/aarch64.rs
src/htm/aarch64.rs
use super::ops::*; #[cfg(target_arch = "aarch64")] use std::arch::aarch64::{ __tcancel, __tcommit, __tstart, __ttest, _TMFAILURE_CNCL, _TMFAILURE_DBG, _TMFAILURE_ERR, _TMFAILURE_IMP, _TMFAILURE_INT, _TMFAILURE_MEM, _TMFAILURE_NEST, _TMFAILURE_REASON, _TMFAILURE_RTRY, _TMFAILURE_SIZE, _TMFAILURE_TRIVIAL, _TMSTART_SUCCESS, }; /// Return code from __tstart() pub struct HwTxBeginCode(u64); impl HwTxBeginCode { #[inline] pub fn started(&self) -> bool { self.0 == _TMSTART_SUCCESS } #[inline] pub fn abort(&self) -> bool { self.0 & _TMFAILURE_CNCL != 0 && !self.started() } #[inline] pub fn retry(&self) -> bool { self.0 & _TMFAILURE_RTRY != 0 && !self.started() } #[inline] pub fn conflict(&self) -> bool { self.0 & _TMFAILURE_MEM != 0 && !self.started() } #[inline] pub fn capacity(&self) -> bool { self.0 & _TMFAILURE_SIZE != 0 && !self.started() } /// Aarch64 specific #[inline] pub fn nest_exceeded(&self) -> bool { self.0 & _TMFAILURE_NEST != 0 && !self.started() } /// Aarch64 specific #[inline] pub fn trivial_exec(&self) -> bool { self.0 & _TMFAILURE_TRIVIAL != 0 && !self.started() } /// Aarch64 specific #[inline] pub fn non_permissible(&self) -> bool { self.0 & _TMFAILURE_ERR != 0 && !self.started() } /// Aarch64 specific #[inline] pub fn interrupted(&self) -> bool { self.0 & _TMFAILURE_INT != 0 && !self.started() } /// Aarch64 specific #[inline] pub fn fallback_failure(&self) -> bool { self.0 & _TMFAILURE_IMP != 0 && !self.started() } #[inline] pub fn debug(&self) -> bool { self.0 & _TMFAILURE_DBG != 0 && !self.started() } } /// most significant 8 bits #[derive(Copy, Clone)] pub enum HwTxAbortCode { Overhaul = 1 << 0, UserlandAbort = 1 << 1, } impl PartialEq for HwTxAbortCode { fn eq(&self, other: &HwTxAbortCode) -> bool { *self as u64 == HTM::_tcancel_code(*other as u64, true) } } /// Return code from __ttest() pub struct HwTxTestCode(u64); impl HwTxTestCode { #[inline] pub fn in_txn(&self) -> bool { self.0 != 0 } #[inline] fn depth(&self) -> usize { self.0 as usize } } pub struct HTM(); impl HTM { const OVERHAUL: u64 = HwTxAbortCode::Overhaul as u64; const USERLAND_ABORT: u64 = HwTxAbortCode::UserlandAbort as u64; /// Encodes cancellation reason, which is the parameter passed to [`__tcancel`] /// Takes cancellation reason flags and retry-ability. #[inline] pub const fn _tcancel_code(reason: u64, retryable: bool) -> u64 { ((retryable as i64) << 15 | (reason & _TMFAILURE_REASON) as i64) as u64 } } impl Ops for HTM { fn begin(&self) -> HwTxBeginCode { unsafe { HwTxBeginCode(__tstart()) } } fn abort(&self, reason_code: &HwTxAbortCode) -> ! { // TODO: Pass retryable as argument? unsafe { match reason_code { HwTxAbortCode::Overhaul => __tcancel(HTM::_tcancel_code(HTM::OVERHAUL, true)), HwTxAbortCode::UserlandAbort => { __tcancel(HTM::_tcancel_code(HTM::USERLAND_ABORT, true)) } } std::hint::unreachable_unchecked() } } fn test(&self) -> HwTxTestCode { unsafe { HwTxTestCode(__ttest()) } } fn commit(&self) { unsafe { __tcommit() } } fn cpu_support(&self) -> bool { std::is_aarch64_feature_detected!("tme") } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/ops.rs
src/htm/ops.rs
//#[cfg_attr(hw, attr)] // Intel RTM #[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), feature = "hw"))] use super::x86_64 as htm; // Aarch64 TME #[cfg(all(target_arch = "aarch64", feature = "hw"))] use super::aarch64 as htm; use crate::txn::errors::{TxnError, TxnResult}; use crate::txn::transact::TxnManager; /// HTM support use htm::*; use log::*; use std::{any::Any, marker::PhantomData}; /// /// Unified interface for TM operations at hw level pub(super) trait Ops { /// /// Runtime: TM hw feature existence fn cpu_support(&self) -> bool; /// /// Begin transactional region fn begin(&self) -> HwTxBeginCode; /// /// Abort transactional region /// /// # Arguments /// * `reason_code` - Abort reason code for reason accepting archs. fn abort(&self, reason_code: &HwTxAbortCode) -> !; /// /// Test if we're in txn region fn test(&self) -> HwTxTestCode; /// /// Commit or end the transactional region fn commit(&self); } pub struct HwTxn(); impl HwTxn { /// /// Initiate hardware transaction with given closure. pub fn begin<F, R>(&self, mut f: F) -> TxnResult<R> where F: FnMut(&mut HTM) -> R, R: 'static + Any + Clone + Send + Sync, { let mut htm = HTM(); let bcode = htm.begin(); let r = loop { if bcode.started() { let res = f(&mut htm); htm.commit(); break Ok(res); } else { let reason = if bcode.started() == false { "NOT_STARTED" } else if bcode.capacity() { "CAPACITY" } else if bcode.abort() { "ABORTED" } else if bcode.retry() { "RETRY_POSSIBLE" } else if bcode.conflict() { "CONFLICT" } else if bcode.debug() { "DEBUG" } else { "CAUSE_UNKNOWN" }; debug!("htx::failure::cause::{}", reason); // TODO: htm.abort(&HwTxAbortCode::UserlandAbort); break Err(TxnError::Abort); } }; r } } #[cfg(test)] mod lever_hwtxn_test { use super::*; use std::sync::atomic::AtomicUsize; use std::sync::atomic::{AtomicPtr, Ordering}; pub fn swallow<T>(d: T) -> T { unsafe { llvm_asm!("" : : "r"(&d)); d } } #[test] fn hwtxn_start() { std::thread::spawn(move || { let hwtxn = HwTxn(); let data = hwtxn.begin(|_htm| 1 + 2); assert_eq!(data.unwrap(), 3); }); } #[test] fn hwtxn_start_arc() { let x = AtomicUsize::new(100); std::thread::spawn(move || { let hwtxn = HwTxn(); let _data = hwtxn.begin(|_htm| x.fetch_add(1, Ordering::Relaxed)); }); } #[test] #[ignore] fn hwtxn_block_test() { let mut x = 123; std::thread::spawn(move || { let htm = HTM(); assert_eq!(true, htm.begin().started()); x = x + 1; assert_eq!(true, htm.test().in_txn()); htm.abort(&HwTxAbortCode::UserlandAbort); assert_eq!(false, htm.test().in_txn()); }); std::thread::spawn(move || { let htm = HTM(); std::thread::sleep(std::time::Duration::from_millis(10)); assert_eq!(true, htm.begin().started()); assert_eq!(true, htm.test().in_txn()); htm.commit(); assert_eq!(false, htm.test().in_txn()); }); } #[test] fn hwtxn_capacity_check() { use std::mem; const CACHE_LINE_SIZE: usize = 64 / mem::size_of::<usize>(); let mut data = vec![0usize; 1_000_000]; let mut capacity = 0; let end = data.len() / CACHE_LINE_SIZE; for i in (0..end).rev() { data[i * CACHE_LINE_SIZE] = data[i * CACHE_LINE_SIZE].wrapping_add(1); swallow(&mut data[i * CACHE_LINE_SIZE]); } for max in 0..end { let _fail_count = 0; let hwtxn = HwTxn(); let _data = hwtxn.begin(|_htm| { for i in 0..max { let elem = unsafe { data.get_unchecked_mut(i * CACHE_LINE_SIZE) }; *elem = elem.wrapping_add(1); } }); capacity = max; } swallow(&mut data); println!("sum: {}", data.iter().sum::<usize>()); println!( "Capacity: {}", capacity * mem::size_of::<usize>() * CACHE_LINE_SIZE ); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/alloc/mod.rs
src/alloc/mod.rs
use anyhow::*; use std::alloc::Layout; pub(crate) fn bucket_allocate_cont<T>(buckets: usize) -> Result<Vec<T>> { // debug_assert!((buckets != 0) && ((buckets & (buckets - 1)) == 0), "Capacity should be power of 2"); // Array of buckets let data = Layout::array::<T>(buckets)?; unsafe { let p = std::alloc::alloc_zeroed(data); Ok(Vec::<T>::from_raw_parts(p as *mut T, 0, buckets)) } } pub(crate) fn bucket_alloc<T>(init_cap: usize) -> Vec<T> where T: Default, { let data = Layout::array::<T>(init_cap).unwrap(); let p = unsafe { std::alloc::alloc_zeroed(data) as *mut T }; unsafe { (0..init_cap).for_each(|i| { std::ptr::write(p.offset(i as isize), T::default()); }); Vec::from_raw_parts(p, init_cap, init_cap) } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/errors.rs
src/txn/errors.rs
use std::result; use thiserror::Error; #[derive(Clone, Error, Debug)] pub enum TxnError { #[error("Retry mechanism triggered")] Retry, #[error("Abort triggered")] Abort, #[error("Txn retry with: {0}")] RetryWithContext(String), #[error("Txn abort with: {0}")] AbortWithContext(String) } pub type TxnResult<T> = result::Result<T, TxnError>;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/vars.rs
src/txn/vars.rs
use std::{ borrow::Borrow, cell::UnsafeCell, marker::PhantomData as marker, ops::{Deref, DerefMut}, sync::{ atomic::{self, Ordering}, Arc, }, time::Duration, }; use super::{ readset::ReadSet, transact::{TransactionState, Txn, TxnManager}, }; use super::version::*; use log::*; use parking_lot::*; use super::utils; use crate::txn::transact::TransactionConcurrency; use crate::txn::writeset::WriteSet; use std::alloc::{dealloc, Layout}; use std::any::Any; /// /// Transactional variable #[derive(Clone)] pub struct TVar<T> where T: Clone + Any + Send + Sync, { pub(crate) data: Var, pub(crate) lock: Arc<ReentrantMutex<bool>>, /// TVar ID pub(crate) id: u64, /// R/W Timestamp pub(crate) stamp: u64, /// Revision of last modification on this key. pub(crate) modrev: u64, timeout: usize, marker: marker<T>, } impl<T> TVar<T> where T: Clone + Any + Send + Sync, { /// /// Instantiates transactional variable for later use in a transaction. pub fn new(data: T) -> Self { TVar { data: Arc::new(data), lock: Arc::new(ReentrantMutex::new(true)), id: TxnManager::dispense_tvar_id(), stamp: TxnManager::rts(), modrev: TxnManager::rts(), timeout: super::constants::DEFAULT_TX_TIMEOUT, marker, } } /// /// New transactional variable with overridden timeout for overriding timeout for specific /// transactional variable. /// /// Highly discouraged for the daily use unless you have various code paths that can /// interfere over the variable that you instantiate. pub fn new_with_timeout(data: T, timeout: usize) -> Self { TVar { data: Arc::new(data), lock: Arc::new(ReentrantMutex::new(true)), id: TxnManager::dispense_tvar_id(), stamp: TxnManager::rts(), modrev: TxnManager::rts(), timeout, marker, } } pub(crate) fn set_stamp(&mut self, stamp: u64) { self.stamp = stamp; } pub(crate) fn set_mod_rev(&mut self, modrev: u64) { self.modrev = modrev; } /// /// Get's the underlying data for the transactional variable. /// /// Beware that this will not give correct results any given point /// in time during the course of execution of a transaction. pub fn get_data(&self) -> T { let val = self.data.clone(); (&*val as &dyn Any) .downcast_ref::<T>() .expect("Only tx vars are allowed for values.") .clone() } pub(crate) fn open_read(&self) -> T { let rs = ReadSet::local(); let txn = Txn::get_local(); let state: &TransactionState = &*txn.state.get(); match state { TransactionState::Committed | TransactionState::Unknown => self.get_data(), TransactionState::Active => { let ws = WriteSet::local(); let scratch = ws.get_by_stamp::<T>(self.stamp); if scratch.is_none() { if self.is_locked() { // TODO: throw abort txn.rollback(); // panic!("READ: You can't lock and still continue processing"); } let tvar = self.clone(); let arctvar = Arc::new(tvar); rs.add(arctvar); self.get_data() } else { let written = scratch.unwrap(); let v: T = utils::version_to_dest(written); v } } TransactionState::MarkedRollback => { debug!("Starting rolling back: {}", TxnManager::rts()); txn.rolling_back(); txn.on_abort::<T>(); self.get_data() } TransactionState::RollingBack => { // Give some time to recover and prevent inconsistency with giving only the pure // data back. // std::thread::sleep(Duration::from_millis(10)); self.get_data() } TransactionState::Suspended => { std::thread::sleep(Duration::from_millis(100)); self.get_data() } TransactionState::RolledBack => { txn.rolled_back(); panic!("Transaction rollback finalized."); } s => { panic!("Unexpected transaction state: {:?}", s); } } } /// /// Convenience over deref mut writes pub(crate) fn open_write_deref_mut(&mut self) -> T { self.open_write(self.get_data()) } /// /// Explicit writes pub(crate) fn open_write(&mut self, data: T) -> T { // dbg!("OPEN WRITE"); let txn = Txn::get_local(); let state: &TransactionState = &*txn.state.get(); match state { TransactionState::Committed | TransactionState::Unknown => self.get_data(), TransactionState::Active => { let mut ws = WriteSet::local(); let this = Arc::new(self.clone()); if ws.get_by_stamp::<T>(this.stamp).is_none() { if self.is_locked() { // TODO: throw abort // panic!("WRITE: You can't lock and still continue processing"); txn.rollback(); } self.modrev = self.modrev.saturating_add(1); let this = Arc::new(self.clone()); ws.put::<T>(this, Arc::new(data.clone())); // match txn.iso { // TransactionIsolation::ReadCommitted => { // dbg!("READ_COMMITTED_COMING"); // if let Some(mut l) = GLOBAL_DELTAS.try_lock() { // let this = Arc::new(self.clone()); // l.push(Version::Write(this)); // } // }, // _ => { // // todo!() // } // } self.data = Arc::new(data.clone()); } self.data = Arc::new(data); self.get_data() } TransactionState::MarkedRollback | TransactionState::RollingBack | TransactionState::RolledBack => { // TODO: Normally aborted, I am still unsure that should I represent this as // full committed read or panic with a fault. // According to science serializable systems get panicked here. // panic!("Panic abort, no writes are possible."); txn.state.replace_with(|_| TransactionState::Unknown); self.get_data() } TransactionState::Suspended => { std::thread::sleep(Duration::from_millis(100)); self.get_data() } s => { panic!("Unexpected transaction state: {:?}", s); } } } pub(crate) fn validate(&self) -> bool { let txn = Txn::get_local(); let state: &TransactionState = &*txn.state.get(); match state { TransactionState::Committed | TransactionState::Unknown => true, TransactionState::Active => { let free = self.is_not_locked_and_current(); let pure = self.stamp <= TxnManager::rts(); free & pure } TransactionState::MarkedRollback | TransactionState::RollingBack | TransactionState::RolledBack => false, s => { panic!("Unexpected transaction state: {:?}", s); } } } pub(crate) fn is_locked(&self) -> bool { self.lock.try_lock().is_none() } pub(crate) fn is_not_locked_and_current(&self) -> bool { !self.is_locked() } pub(crate) fn is_writer_held_by_current_thread(&self) -> bool { self.is_locked() } } impl<T: Any + Clone + Send + Sync> Deref for TVar<T> { type Target = T; fn deref(&self) -> &T { let x: *mut T = BoxMemory.allocate(self.open_read()); unsafe { &*(x) } } } impl<T: 'static + Any + Clone + Send + Sync> DerefMut for TVar<T> { fn deref_mut(&mut self) -> &mut T { let x: *mut T = BoxMemory.allocate(self.open_write_deref_mut()); unsafe { &mut *(x) } } } /// A type that can allocate and deallocate far heap memory. pub(crate) trait Memory { /// Allocates memory. fn allocate<T>(&self, value: T) -> *mut T; /// Deallocates the memory associated with the supplied pointer. unsafe fn deallocate<T>(&self, pointer: *mut T); } #[derive(Copy, Clone, Debug)] pub(crate) struct BoxMemory; impl BoxMemory { pub(crate) fn reclaim<T>(&self, pointer: *const T) -> T { assert!(!pointer.is_null()); unsafe { std::ptr::read_volatile::<T>(pointer as *mut T) } } pub(crate) fn reclaim_mut<T>(&self, pointer: *mut T) -> T { assert!(!pointer.is_null()); unsafe { std::ptr::read_volatile::<T>(pointer) } } pub(crate) fn volatile_read<T: Clone>(&self, pointer: *mut T) -> T { assert!(!pointer.is_null()); unsafe { std::ptr::read_volatile::<T>(pointer) } } pub(crate) fn deallocate_raw<T>(&self, p: *mut T) { unsafe { std::ptr::drop_in_place(p); dealloc(p as *mut u8, Layout::new::<T>()); } } pub(crate) fn replace_with<T: Clone, X>(&self, ptr: *mut T, mut thunk: X) where X: FnMut(T) -> T, { let read = unsafe { std::ptr::read_volatile::<T>(ptr as *const T) }; let res = thunk(read); unsafe { std::ptr::write_volatile::<T>(ptr, res) }; } } impl Memory for BoxMemory { fn allocate<T>(&self, value: T) -> *mut T { Box::into_raw(Box::new(value)) } unsafe fn deallocate<T>(&self, pointer: *mut T) { assert!(!pointer.is_null()); drop(Box::from_raw(pointer)); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/version.rs
src/txn/version.rs
use std::any::Any; use std::fmt; use std::fmt::Formatter; use std::hash::{Hash, Hasher}; use std::marker::PhantomData as marker; use std::ptr::NonNull; use std::sync::atomic::AtomicUsize; use std::sync::Arc; pub type Var = Arc<dyn Any + Send + Sync>; #[derive(Clone)] pub enum Version { Read(Var), Write(Var), } impl Version { pub fn extract(&self) -> &Var { match self { Version::Read(x) => x, Version::Write(x) => x, } } pub fn read(&self) -> Var { return match &*self { &Version::Read(ref v) | &Version::Write(ref v) => v.clone(), }; } pub fn write(&mut self, w: Var) { *self = match self.clone() { Version::Write(_) => Version::Write(w), // TODO: Not sure _ => Version::Write(w), }; } } impl fmt::Debug for Version { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("Version").field("var", &self).finish() } } impl Hash for Version { fn hash<H: Hasher>(&self, state: &mut H) { let x: ArcLayout<dyn Any + Send + Sync> = unsafe { std::mem::transmute_copy(&self.read()) }; x.ptr.as_ptr().hash(state); } } impl PartialEq for Version { fn eq(&self, other: &Self) -> bool { match (self, other) { (Version::Read(left), Version::Read(right)) => Arc::ptr_eq(&left, &right), (Version::Write(left), Version::Write(right)) => Arc::ptr_eq(&left, &right), _ => false, } } } impl Eq for Version {} #[repr(C)] struct ArcInnerLayout<T: ?Sized> { strong: AtomicUsize, weak: AtomicUsize, data: T, } struct ArcLayout<T: ?Sized> { ptr: NonNull<ArcInnerLayout<T>>, phantom: marker<ArcInnerLayout<T>>, }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/readset.rs
src/txn/readset.rs
use super::utils; use super::vars::TVar; use crate::txn::conflicts::*; use crate::txn::version::{Var, Version}; use std::cell::RefCell; use std::{ borrow::{Borrow, BorrowMut}, collections::HashSet, }; thread_local! { // real: Arc<TVar<T>> // virtual: Var pub(crate) static LRS: RefCell<HashSet<Version>> = RefCell::new(HashSet::new()); } // HashSet<*mut LockVar<T>> pub struct ReadSet(pub HashSet<Version>); impl ReadSet { fn new() -> Self { Self(LRS.with(|hs| { let hs = hs.borrow(); hs.clone() })) } pub fn local() -> Self { Self::new() } pub fn get_all(&self) -> Vec<Var> { self.0.iter().map(|e| e.read()).collect() } pub fn get_all_versions(&self) -> Vec<&Version> { self.0.iter().collect() } pub fn get<T: Clone>(&self, seek: Version) -> Option<Var> { self.0.iter().find(|x| **x == seek).map(|f| f.read()) } pub fn add(mut self, e: Var) { let v = Version::Read(e); self.0.insert(v); LRS.with(|hs| { let mut hs = hs.borrow_mut(); *hs = self.0.clone(); }); } pub(in crate::txn) fn cmps<T: 'static + Clone + Sync + Send>(&self) -> Vec<Compare> { let mut cmset = Vec::with_capacity(self.0.len()); self.0.iter().for_each(|v| { let var: TVar<T> = utils::version_to_tvar(v); let cmp = Compare::new(var.modrev, var.modrev == var.stamp, CompareSet::ReadLocal); cmset.push(cmp); }); cmset } /// First stamp pub(crate) fn first<T: 'static + Clone + Sync + Send>(&self) -> u64 { let mut min_stamp = u64::MAX; for x in self.0.iter() { let v: TVar<T> = utils::version_to_tvar(x); // dbg!(v.stamp); if v.stamp < min_stamp { min_stamp = v.stamp; } } // dbg!("======="); min_stamp } pub fn clear(&mut self) { // TODO: Drop all here from get_all self.0.clear(); LRS.with(|hs| { let mut hs = hs.borrow_mut(); *hs = self.0.clone(); }); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/utils.rs
src/txn/utils.rs
use crate::txn::vars::TVar; use crate::txn::version::*; use std::any::Any; use std::sync::Arc; pub(crate) fn convert_ref<R: Any + Clone + Send + Sync>(from: Var) -> R { (&*from as &dyn Any).downcast_ref::<R>().unwrap().clone() } // TODO: Nightly stuff, polish up a bit with feature gates. // pub fn print_type_of<T>(_: &T) { // println!("{}", unsafe { std::intrinsics::type_name::<T>() }); // } pub(crate) fn direct_convert_ref<R: Any + Clone + Send + Sync>(from: &Var) -> R { (&*from as &dyn Any).downcast_ref::<R>().unwrap().clone() } pub(crate) fn downcast<R: 'static + Clone>(var: Arc<dyn Any>) -> R { match var.downcast_ref::<R>() { Some(s) => s.clone(), None => unreachable!("Requested wrong type for Var"), } } pub(crate) fn version_to_tvar<T: Any + Clone + Send + Sync>(ver: &Version) -> TVar<T> { let x: *const dyn Any = Arc::into_raw(ver.read()); let xptr: *const TVar<T> = x as *const TVar<T>; let k: Arc<TVar<T>> = unsafe { Arc::from_raw(xptr) }; let k: TVar<T> = downcast(k); k } pub(crate) fn version_to_dest<T: Any + Clone + Send + Sync>(ver: &Version) -> T { let x: *const dyn Any = Arc::into_raw(ver.read()); let xptr: *const T = x as *const T; let k: Arc<T> = unsafe { Arc::from_raw(xptr) }; let k: T = downcast(k); k }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/conflicts.rs
src/txn/conflicts.rs
use super::transact::TransactionIsolation; use crate::txn::readset::ReadSet; use crate::txn::writeset::WriteSet; use std::cmp::Ordering; #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub(in crate::txn) enum CompareSet { ReadLocal, WriteLocal, } #[derive(Clone, Debug, PartialEq, Eq, Ord)] pub(in crate::txn) struct Compare { rev: u64, current: bool, set: CompareSet, } impl Compare { pub(in crate::txn) fn new(rev: u64, current: bool, set: CompareSet) -> Self { Self { rev, current, set } } pub(in crate::txn) fn check(&self, other: &Compare, ordering: Ordering) -> bool { self.cmp(&other) == ordering } } impl PartialOrd for Compare { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.rev.cmp(&other.rev)) } } pub(crate) struct ConflictManager; impl ConflictManager { pub(crate) fn check<T: 'static + Clone + Sync + Send>(iso: &TransactionIsolation) -> bool { match iso { // Serializable is also a checking for write conflicts, seprated from serializable reads only mode. // Serializable will do check for write conflicts too. Even that would never happen. TransactionIsolation::Serializable => { let rs = ReadSet::local(); let ws = WriteSet::local(); let mut linear = rs.cmps::<T>(); let _writes_before_rev: Vec<Compare>; let pinned_rev = rs.first::<T>().checked_add(1).unwrap_or(u64::MAX); let writes_before_rev = ws.writes_before::<T>(pinned_rev); linear.extend(writes_before_rev); // dbg!(&linear); linear.iter().all(|x| x.current) } TransactionIsolation::RepeatableRead => { let rs = ReadSet::local(); let cmps = rs.cmps::<T>(); cmps.iter().all(|x| x.current) } TransactionIsolation::ReadCommitted => true, } } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/mod.rs
src/txn/mod.rs
mod conflicts; mod constants; mod readset; mod utils; mod version; mod writeset; /// Transactional system errors pub mod errors; /// Transaction management definitions pub mod transact; /// Transactional variable definitions pub mod vars; /// Prelude of transactional system pub mod prelude { pub use super::transact::*; pub use super::vars::*; }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/writeset.rs
src/txn/writeset.rs
use super::vars::TVar; use crate::sync::treiber::TreiberStack; use std::cell::RefCell; use std::{ borrow::{Borrow, BorrowMut}, collections::HashMap, collections::HashSet, ptr::NonNull, }; use std::{fmt, time::Duration}; use super::utils; use crate::txn::conflicts::*; use crate::txn::version::{Var, Version}; use std::any::Any; thread_local! { // real: LockVar<T>, T, virt: VersionWrite, VersionWrite static LWS: RefCell<HashMap<Version, Version>> = RefCell::new(HashMap::new()); } // HashMap<*mut LockVar<T>, *mut T> pub struct WriteSet(HashMap<Version, Version>); impl WriteSet { fn new() -> Self { Self(LWS.with(|hs| hs.borrow_mut().clone())) } pub fn local() -> Self { let x = Self::new(); // dbg!(&x); x } pub fn get<T: Clone + Send + Sync>(&self, e: Var) -> Option<&Version> { self.0.get(&Version::Write(e)) } pub fn get_by_stamp<T: 'static + Clone + Send + Sync>(&self, stamp: u64) -> Option<&Version> { self.0 .iter() .find(|(tv, _)| { let tvar: TVar<T> = utils::version_to_tvar(tv); tvar.stamp == stamp }) .map(|g| g.1) } pub fn put<T: 'static + Clone + Send + Sync>(&mut self, k: Var, v: Var) { let kver = Version::Write(k); let vver = Version::Write(v); self.0.insert(kver, vver); LWS.with(|hs| { let mut hs = hs.borrow_mut(); *hs = self.0.clone(); }); } pub fn try_lock<T: 'static + Clone + Send + Sync>(&mut self, timeout: Duration) -> bool { let ts = TreiberStack::<Var>::new(); for (k, _) in self.0.iter_mut() { let read_val = k.read(); // utils::print_type_of(&read_val); let v: Var = utils::direct_convert_ref(&read_val); ts.push(v.clone()); let kv = TVar::new(v.clone()); if kv.lock.try_lock_for(timeout).is_some() { ts.pop(); // TODO: Not sure if return false or just ignore } else { return false; } } true } pub fn get_all<T: 'static + Any + Clone + Send + Sync>(&self) -> Vec<(TVar<T>, T)> { self.0 .iter() .map(|(kp, vp)| { let k: TVar<T> = utils::version_to_dest(kp); let v: T = utils::version_to_dest(vp); (k, v) }) .collect() } pub fn get_all_keys<T: 'static + Clone + Send + Sync>(&self) -> Vec<TVar<T>> { self.0 .keys() .map(|p| { let v: TVar<T> = utils::version_to_tvar(p); v }) .collect::<Vec<TVar<T>>>() } pub fn unlock<T: 'static + Clone + Send + Sync>(&self) { self.get_all_keys().iter().for_each(|_x: &TVar<T>| { // TODO: Store guards and drop here for convenience. // Normally not needed, anyway. // dbg!("Try unlock"); // unsafe { x.lock.force_unlock_fair(); } }) } pub(in crate::txn) fn writes_before<T: 'static + Clone + Send + Sync>( &self, rev: u64, ) -> Vec<Compare> { let mut wts = Vec::with_capacity(self.0.len()); self.0.iter().for_each(|(k, _v)| { let var: TVar<T> = utils::version_to_tvar(k); if var.modrev < rev { let cmp = Compare::new(var.modrev, true, CompareSet::WriteLocal); wts.push(cmp); } }); wts } pub fn clear<T: Clone + Send + Sync>(&mut self) { // TODO: Drop all here from get_all self.0.clear(); LWS.with(|lws| { let mut ws = lws.borrow_mut(); *ws = self.0.clone(); // ws.clear(); }) } } impl fmt::Debug for WriteSet { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("WriteSet").field("ws", &self.0).finish() } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/constants.rs
src/txn/constants.rs
use super::transact::{TransactionConcurrency, TransactionIsolation}; pub(crate) const DEFAULT_TX_TIMEOUT: usize = 0_usize; pub(crate) const DEFAULT_TX_SERIALIZABLE_ENABLED: bool = false; pub(crate) const DEFAULT_TX_CONCURRENCY: TransactionConcurrency = TransactionConcurrency::Pessimistic; pub(crate) const DEFAULT_TX_ISOLATION: TransactionIsolation = TransactionIsolation::RepeatableRead;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/transact.rs
src/txn/transact.rs
use log::*; use crate::{ sync::{atomics::AtomicBox, treiber::TreiberStack}, table::prelude::*, }; use std::{ sync::atomic::{AtomicU64, Ordering}, thread, }; use thread::ThreadId; use super::errors::*; use super::readset::ReadSet; use super::utils; use crate::sync::ttas::TTas; use std::cell::RefCell; use std::{ borrow::{Borrow, BorrowMut}, time::Duration, }; use std::{ collections::BTreeMap, sync::{ atomic::{AtomicBool, AtomicPtr}, Arc, }, }; use crate::txn::conflicts::ConflictManager; use crate::txn::vars::TVar; use crate::txn::version::Version; use crate::txn::writeset::WriteSet; use lazy_static::*; use std::any::Any; #[derive(Debug, Clone)] /// /// Concurrency control for transaction system pub enum TransactionConcurrency { /// /// Optimistic Concurrency Control Optimistic, /// /// Pessimistic Concurrency Control Pessimistic, } #[derive(Debug, Clone)] /// /// Transaction Isolation levels for transaction system pub enum TransactionIsolation { /// /// [TransactionIsolation::ReadCommitted] isolation level means that always a committed value will be /// provided for read operations. Values are always read from in-memory cache every time a /// value is accessed. In other words, if the same key is accessed more than once within the /// same transaction, it may have different value every time since global cache memory /// may be updated concurrently by other threads. ReadCommitted, /// /// [TransactionIsolation::RepeatableRead] isolation level means that if a value was read once within transaction, /// then all consecutive reads will provide the same in-transaction value. With this isolation /// level accessed values are stored within in-transaction memory, so consecutive access to /// the same key within the same transaction will always return the value that was previously /// read or updated within this transaction. If concurrency is /// [TransactionConcurrency::Pessimistic], then a lock on the key will be acquired /// prior to accessing the value. RepeatableRead, /// /// [TransactionIsolation::Serializable] isolation level means that all transactions occur in a completely isolated fashion, /// as if all transactions in the system had executed serially, one after the other. Read access /// with this level happens the same way as with [TransactionIsolation::RepeatableRead] level. /// However, in [TransactionConcurrency::Optimistic] mode, if some transactions cannot be /// serially isolated from each other, then one winner will be picked and the other /// transactions in conflict will result with abort. Serializable, } #[derive(Debug, Clone)] /// /// State of the transaction which can be at any given time pub enum TransactionState { Active, Preparing, Prepared, MarkedRollback, Committing, Committed, RollingBack, RolledBack, Unknown, Suspended, } impl Default for TransactionState { fn default() -> Self { TransactionState::Unknown } } /// /// Management struct for single transaction /// /// This struct exposes various methods for controlling the transaction state throughout it's lifetime. #[derive(Clone)] pub struct Txn { /// Id of the transaction config tx_config_id: u64, // NOTE: NonZeroU64 is std lib thread id interpret. Wait for the feature flag removal. /// Id of the thread in which this transaction started. tid: ThreadId, /// Txn isolation level pub(crate) iso: TransactionIsolation, /// Txn concurrency level pub(crate) cc: TransactionConcurrency, /// Txn state pub(crate) state: Arc<AtomicBox<TransactionState>>, /// Txn timeout /// /// * Gets timeout value in milliseconds for this transaction. timeout: usize, /// If transaction was marked as rollback-only. rollback_only: Arc<AtomicBool>, /// Label of the transaction label: String, } impl Txn { /// /// Initiate transaction with given closure. pub fn begin<F, R>(&self, mut f: F) -> TxnResult<R> where F: FnMut(&mut Txn) -> R, R: 'static + Any + Clone + Send + Sync, { let r = loop { trace!("tx_begin_read::txid::{}", TxnManager::rts()); let me = self.clone(); Self::set_local(me); // Refurbish let mut me = Self::get_local(); me.on_start(); ///////////////////////// let res = f(&mut me); if me.on_validate::<R>() && me.commit() { me.on_commit::<R>(); break res; } ///////////////////////// me.on_abort::<R>(); }; Ok(r) } /// /// Read initiator to the scratchpad from transactional variables. pub fn read<T: Send + Sync + Any + Clone>(&self, var: &TVar<T>) -> T { var.open_read() } /// /// Write back initiator for given transactional variables. pub fn write<T: Send + Sync + Any + Clone>(&mut self, var: &mut TVar<T>, value: T) -> T { var.open_write(value) } /// Modify the transaction associated with the current thread such that the /// only possible outcome of the transaction is to roll back the /// transaction. pub fn set_rollback_only(&mut self, flag: bool) { self.rollback_only.swap(flag, Ordering::SeqCst); } /// Commits this transaction by initiating two-phase-commit process. pub fn commit(&self) -> bool { self.state.replace_with(|_| TransactionState::Committed); true } /// Ends the transaction. Transaction will be rolled back if it has not been committed. pub fn close(&self) { todo!() } /// Rolls back this transaction. /// It's allowed to roll back transaction from any thread at any time. pub fn rollback(&self) { self.state .replace_with(|_| TransactionState::MarkedRollback); } /// Resume a transaction if it was previously suspended. /// Supported only for optimistic transactions. pub fn resume(&self) { match self.cc { TransactionConcurrency::Optimistic => { self.state.replace_with(|_| TransactionState::Active); } _ => {} } } /// Suspends a transaction. It could be resumed later. /// Supported only for optimistic transactions. pub fn suspend(&self) { match self.cc { TransactionConcurrency::Optimistic => { self.state.replace_with(|_| TransactionState::Suspended); } _ => {} } } /// /// Get current transaction state pub fn state(&self) -> Arc<TransactionState> { self.state.get() } /// /// Internal stage to update in-flight rollback pub(crate) fn rolling_back(&self) { self.state.replace_with(|_| TransactionState::RollingBack); } /// /// Internal stage to finalize rollback pub(crate) fn rolled_back(&self) { self.state.replace_with(|_| TransactionState::RolledBack); } /// /// Set the transaction going. /// Callback that will run before everything starts fn on_start(&self) { TxnManager::set_rts(); self.state.replace_with(|_| TransactionState::Active); } /// /// Validates a transaction. /// Call this code when a transaction must decide whether it can commit. fn on_validate<T: 'static + Any + Clone + Send + Sync>(&self) -> bool { let mut ws = WriteSet::local(); let rs = ReadSet::local(); // TODO: Nanos or millis? Millis was the intention. if !ws.try_lock::<T>(Duration::from_millis(self.timeout as u64)) { // TODO: Can't acquire lock, write some good message here. // dbg!("Can't acquire lock"); return false; } for x in rs.get_all_versions().iter().cloned() { let v: TVar<T> = utils::version_to_dest(x); if v.is_locked() && !v.is_writer_held_by_current_thread() { // TODO: MSG: Currently locked // dbg!("Currently locked"); return false; } if !v.validate() { // TODO: MSG: Can't validate // dbg!("Can't validate"); return false; } } true } /// /// Finalizing the commit and flush the write-backs to the main memory fn on_commit<T: Any + Clone + Send + Sync>(&mut self) { if !ConflictManager::check::<T>(&self.iso) { self.on_abort::<T>(); } let mut ws = WriteSet::local(); let mut rs = ReadSet::local(); // TODO: MSG: // dbg!("Updating ws"); TxnManager::set_wts(); // TODO: MSG: // dbg!("Updated ws"); let w_ts = TxnManager::rts(); // TODO: MSG: // dbg!("Get write TS"); for (k, source) in ws.get_all::<T>().iter_mut() { // let mut dest: T = k.open_read(); k.data = Arc::new(source.clone()); k.set_stamp(w_ts); debug!("Enqueued writes are written"); } ws.unlock::<T>(); ws.clear::<T>(); rs.clear(); } #[cold] pub(crate) fn on_abort<T: Clone + Send + Sync>(&self) { let mut ws = WriteSet::local(); let mut rs = ReadSet::local(); // TODO: MSG // dbg!("ON ABORT"); TxnManager::set_rts(); ws.clear::<T>(); rs.clear(); } /// Sets tlocal txn. pub(crate) fn set_local(ntxn: Txn) { TXN.with(|txn| { let mut txn = txn.borrow_mut(); *txn = ntxn; }) } /// Gets tlocal txn. pub fn get_local() -> Txn { // TODO: not sure TXN.with(|tx| tx.borrow().clone()) } pub(crate) fn get_txn_config_id(&self) -> u64 { self.tx_config_id } } impl Default for Txn { #[cfg_attr(miri, ignore)] fn default() -> Self { Self { tx_config_id: 0, tid: thread::current().id(), iso: TransactionIsolation::ReadCommitted, cc: TransactionConcurrency::Optimistic, state: Arc::new(AtomicBox::new(TransactionState::default())), timeout: 0, rollback_only: Arc::new(AtomicBool::default()), label: "default".into(), } } } thread_local! { static LOCAL_VC: RefCell<u64> = RefCell::new(0_u64); static TXN: RefCell<Txn> = RefCell::new(Txn::default()); } lazy_static! { /// Global queues of transaction deltas. pub(crate) static ref GLOBAL_DELTAS: Arc<TTas<Vec<Version>>> = Arc::new(TTas::new(Vec::new())); /// TVar ids across all txns in the tx manager pub(crate) static ref GLOBAL_TVAR: Arc<AtomicU64> = Arc::new(AtomicU64::default()); /// Version clock across all transactions pub(crate) static ref GLOBAL_VCLOCK: Arc<AtomicU64> = Arc::new(AtomicU64::default()); } // Management layer /// /// Global level transaction management structure. /// /// This struct manages transactions across the whole program. /// Manager's clock is always forward moving. pub struct TxnManager { pub(crate) txid: Arc<AtomicU64>, } impl TxnManager { /// /// Instantiate transaction manager pub fn manager() -> Arc<TxnManager> { Arc::new(TxnManager { txid: Arc::new(AtomicU64::new(GLOBAL_VCLOCK.load(Ordering::SeqCst))), }) } /// /// VC management: Sets read timestamp for the ongoing txn pub(crate) fn set_rts() { LOCAL_VC.with(|lvc| { let mut lvc = lvc.borrow_mut(); *lvc = GLOBAL_VCLOCK.load(Ordering::SeqCst); }); } /// /// VC management: Reads read timestamp for the ongoing txn pub(crate) fn rts() -> u64 { LOCAL_VC.with(|lvc| *lvc.borrow()) } /// /// VC management: Sets write timestamp for the ongoing txn pub(crate) fn set_wts() { LOCAL_VC.with(|lvc| { let mut lvc = lvc.borrow_mut(); *lvc = GLOBAL_VCLOCK .fetch_add(1, Ordering::SeqCst) .saturating_add(1); }) } /// /// Dispense a new TVar ID pub(crate) fn dispense_tvar_id() -> u64 { GLOBAL_TVAR.fetch_add(1, Ordering::SeqCst).saturating_add(1) } /// /// Get latest dispensed TVar ID pub(crate) fn latest_tvar_id() -> u64 { GLOBAL_TVAR.fetch_add(1, Ordering::SeqCst) } /// /// Starts transaction with specified isolation, concurrency, timeout, invalidation flag, /// and number of participating entries. /// /// # Arguments /// * `cc`: [Concurrency Control](TransactionConcurrency) setting /// * `iso`: [Transaction Isolation](TransactionIsolation) setting /// * `timeout`: Timeout /// * `tx_size`: Number of entries participating in transaction (may be approximate). pub fn txn_build( &self, cc: TransactionConcurrency, iso: TransactionIsolation, timeout: usize, _tx_size: usize, label: String, ) -> Txn { // match (&iso, &cc) { // (TransactionIsolation::ReadCommitted, TransactionConcurrency::Optimistic) => { // todo!("OCC, with Read Committed, hasn't been implemented."); // } // (_, TransactionConcurrency::Pessimistic) => { // todo!("PCC, with all isolation levels, hasn't been implemented."); // } // _ => {} // } Txn { tx_config_id: self.txid.load(Ordering::SeqCst), // tid: thread::current().id(), // Reset to thread id afterwards. iso, cc, state: Arc::new(AtomicBox::new(TransactionState::default())), timeout, rollback_only: Arc::new(AtomicBool::default()), label, } } } #[cfg(test)] mod txn_tests { use super::*; #[test] fn txn_optimistic_read_committed() { let data = 100_usize; let txn = TxnManager::manager().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::ReadCommitted, 100_usize, 1_usize, "txn_optimistic_read_committed".into(), ); let mut threads = vec![]; let tvar = TVar::new(data); // TODO: Try with less congestion to abuse optimistic cc. for thread_no in 0..2 { let txn = txn.clone(); let mut tvar = tvar.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { if thread_no == 0 { // Streamliner thread *tvar = txn .begin(|t| { let x = t.read(&tvar); assert_eq!(x, 100); thread::sleep(Duration::from_millis(300)); dbg!(t.state()); dbg!("=================="); let x = t.read(&tvar); dbg!(t.state()); assert_eq!(x, 100); x }) .unwrap(); } else { // Interceptor thread *tvar = txn .begin(|t| { thread::sleep(Duration::from_millis(100)); let mut x = t.read(&tvar); assert_eq!(x, 100); x = 123_000; dbg!(t.state()); // -- Either marked rollback, or marked commit t.write(&mut tvar, x); thread::sleep(Duration::from_millis(100)); let x = t.read(&tvar); dbg!(t.state()); if x == 100 || x == 123_000 { dbg!(x); assert!(true) } x }) .unwrap(); } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { t.join().unwrap(); } } #[test] fn txn_optimistic_repeatable_read() { let data = 100_usize; let txn = TxnManager::manager().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::RepeatableRead, 100_usize, 1_usize, "txn_optimistic_repeatable_read".into(), ); let mut threads = vec![]; let tvar = TVar::new(data); for thread_no in 0..100 { let txn = txn.clone(); let mut tvar = tvar.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { if thread_no == 0 { // Streamliner thread txn.begin(|t| { let x = t.read(&tvar); assert_eq!(x, 100); thread::sleep(Duration::from_millis(300)); let x = t.read(&tvar); assert_eq!(x, 100); }) } else { // Interceptor thread txn.begin(|t| { thread::sleep(Duration::from_millis(100)); let mut x = t.read(&tvar); if x == 100 || x == 123_000 { assert!(true) } x = 123_000; t.write(&mut tvar, x); thread::sleep(Duration::from_millis(100)); }) } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { t.join().unwrap(); } } #[test] fn txn_optimistic_serializable() { let data = 100_usize; let txn = TxnManager::manager().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::Serializable, 100_usize, 1_usize, "txn_optimistic_serializable".into(), ); let mut threads = vec![]; let tvar = TVar::new(data); for thread_no in 0..100 { let txn = txn.clone(); let mut tvar = tvar.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { if thread_no % 2 == 0 { // Streamliner thread *tvar = txn .begin(|t| { let x = t.read(&tvar); assert_eq!(x, 100); thread::sleep(Duration::from_millis(300)); let mut x = t.read(&tvar); assert_eq!(x, 100); x = 1453; t.write(&mut tvar, x); t.read(&tvar) }) .unwrap(); } else { // Interceptor thread *tvar = txn .begin(|t| { thread::sleep(Duration::from_millis(100)); let mut x = t.read(&tvar); if x == 100 || x == 123_000 { assert!(true) } x = 123_000; t.write(&mut tvar, x); thread::sleep(Duration::from_millis(100)); x }) .unwrap(); } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { // TODO: Write skews can make this fail. In snapshot mode. let _ = t.join().unwrap(); } } #[test] fn txn_pessimistic_serializable() { let data = 100_usize; let txn = TxnManager::manager().txn_build( TransactionConcurrency::Pessimistic, TransactionIsolation::Serializable, 100_usize, 1_usize, "txn_pessimistic_serializable".into(), ); let mut threads = vec![]; let tvar = TVar::new(data); for thread_no in 0..100 { let txn = txn.clone(); let mut tvar = tvar.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { if thread_no % 2 == 0 { // Streamliner thread *tvar = txn .begin(|t| { let x = t.read(&tvar); if x == 100 || x == 1453 { assert!(true) } thread::sleep(Duration::from_millis(300)); let mut x = t.read(&tvar); if x == 100 || x == 1453 { assert!(true) } x = 1453; t.write(&mut tvar, x); t.read(&tvar) }) .unwrap(); } else { // Interceptor thread *tvar = txn .begin(|t| { thread::sleep(Duration::from_millis(100)); let mut x = t.read(&tvar); if x == 100 || x == 123_000 { assert!(true) } x = 123_000; t.write(&mut tvar, x); thread::sleep(Duration::from_millis(100)); x }) .unwrap(); } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { // TODO: Write skews can make this fail. In snapshot mode. let _ = t.join().unwrap(); } } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/hoptable.rs
src/table/hoptable.rs
use crate::sync::atomics::AtomicBox; use anyhow::*; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; use std::hash::Hash; use std::hash::{BuildHasher, Hasher}; use std::{ alloc::Layout, collections::hash_map::{Iter, Keys, RandomState}, }; const HOP_RANGE: usize = 1 << 5; const ADD_RANGE: usize = 1 << 8; const MAX_SEGMENTS: usize = 1 << 20; const HOLE_EXIST: isize = -1; const ALREADY_FILLED: isize = -2; // TODO: KeyState should enable overflows on binary heap or such. enum KeyState { Index(isize), HoleExist, AlreadyFilled, } /// /// Lever Neighborhood based cache-oblivious concurrent table. /// /// Designed for fast access under heavy contention. /// Best for related lookups in the known key space. /// Also best for buffer management. pub struct HOPTable<K, V, S = RandomState> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync, V: 'static + Clone + Send + Sync, S: BuildHasher, { segments: Vec<Bucket<K, V>>, max_segments: usize, hash_builder: S, } impl<K, V> HOPTable<K, V, RandomState> where K: PartialEq + Eq + Hash + Clone + Send + Sync, V: Clone + Send + Sync, { pub fn new() -> Self { Self::with_capacity(MAX_SEGMENTS) } pub fn with_capacity(cap: usize) -> Self { assert!( (cap != 0) && ((cap & (cap - 1)) == 0), "Capacity should be power of 2" ); Self::with_capacity_and_hasher(cap, RandomState::new()) } } impl<K, V, S> HOPTable<K, V, S> where K: PartialEq + Eq + Hash + Clone + Send + Sync, V: Clone + Send + Sync, S: BuildHasher, { fn with_capacity_and_hasher(cap: usize, hasher: S) -> HOPTable<K, V, S> { Self { segments: (0..cap + (1 << 8)).map(|_| Bucket::default()).collect(), max_segments: cap, hash_builder: hasher, } } fn hash(&self, key: &K) -> usize { let mut hasher = self.hash_builder.build_hasher(); key.hash(&mut hasher); hasher.finish() as usize & (self.max_segments - 1) } fn seek_segment(&self, key: &K) -> Option<Bucket<K, V>> { let idx = self.key_index(key); if idx != !0 { Some(self.segments[idx as usize].clone()) } else { None } } // FIXME: no pub pub(crate) fn key_index(&self, k: &K) -> isize { let hash = self.hash(k); let start_bucket = self.segments[hash].clone(); let mut mask = 1; for i in (0..HOP_RANGE).into_iter() { if (mask & start_bucket.hop_info.load(Ordering::Acquire)) >= 1 { let check_bucket = self.segments[hash + i].clone(); let keyv = self.extract(check_bucket.key.get()); if Some(k) == keyv.as_ref() { return (hash + i) as isize; } } mask = mask << 1; } HOLE_EXIST } fn atomic_remove(&self, k: &K) -> Arc<Option<V>> { let hash = self.hash(k); let start_bucket = self.segments[hash].clone(); let remove_bucket_idx = self.key_index(k); let distance = remove_bucket_idx as usize - hash; if remove_bucket_idx > !0 { let remove_bucket = self.segments[remove_bucket_idx as usize].clone(); let rc = remove_bucket.data.get(); remove_bucket.key.replace_with(|_| None); remove_bucket.data.replace_with(|_| None); let st = start_bucket.hop_info.load(Ordering::Acquire); start_bucket .hop_info .store(st & !(1 << distance), Ordering::Relaxed); return rc; } Arc::new(None) } #[inline] pub fn remove(&self, k: &K) -> Result<Arc<Option<V>>> { Ok(self.atomic_remove(k)) // TODO: Fallback Lock } #[inline] pub fn get(&self, k: &K) -> Option<V> { if let Some(seg) = self.seek_segment(k) { let val = seg.data.get(); return self.extract(val).clone(); } None } fn extract<A>(&self, val: Arc<A>) -> &A { unsafe { &*Arc::downgrade(&val).as_ptr() } } fn atomic_insert( &self, start_bucket: &Bucket<K, V>, free_bucket: &Bucket<K, V>, k: &K, v: &V, free_distance: usize, ) -> bool { if self.key_index(k) == HOLE_EXIST { let sbhi = start_bucket.hop_info.load(Ordering::Acquire); start_bucket .hop_info .store(sbhi | (1 << free_distance), Ordering::Release); free_bucket.data.replace_with(|_| Some(v.clone())); free_bucket.key.replace_with(|_| Some(k.clone())); return true; } false } #[inline] pub fn insert(&self, k: K, v: V) -> Result<Arc<Option<V>>> { if let Some(_) = self.seek_segment(&k) { let _ = self.remove(&k); } self.new_insert(k, v) } fn new_insert(&self, k: K, v: V) -> Result<Arc<Option<V>>> { let mut val = 1; let hash = self.hash(&k); let start_bucket = self.segments[hash].clone(); let mut free_bucket_idx = hash; let mut free_bucket = self.segments[free_bucket_idx].clone(); let mut free_distance = 0; for _ in (free_distance..ADD_RANGE).into_iter() { if free_bucket.key.get().is_none() { break; } free_distance += 1; free_bucket_idx += 1; free_bucket = self.segments[free_bucket_idx].clone(); } if free_distance < ADD_RANGE { while let true = 0 != val { if free_distance < HOP_RANGE { if self.atomic_insert(&start_bucket, &free_bucket, &k, &v, free_distance) { return Ok(Arc::new(Some(v))); } else { return Ok(Arc::new(None)); } } else { let closest_binfo = self.find_closer_bucket(free_bucket_idx, free_distance, val); free_distance = closest_binfo[0]; val = closest_binfo[1]; free_bucket_idx = closest_binfo[2]; free_bucket = self.segments[free_bucket_idx].clone(); } } } Ok(Arc::new(None)) } fn find_closer_bucket( &self, free_bucket_index: usize, mut free_distance: usize, val: usize, ) -> [usize; 3] { let mut result = [0; 3]; let mut move_bucket_index = free_bucket_index - (HOP_RANGE - 1); let mut move_bucket = self.segments[move_bucket_index].clone(); for free_dist in (1..HOP_RANGE).rev() { let start_hop_info = move_bucket.hop_info.load(Ordering::Acquire); let mut move_free_distance: isize = !0; let mut mask = 1; for i in (0..free_dist).into_iter() { if (mask & start_hop_info) >= 1 { move_free_distance = i as isize; break; } mask = mask << 1; } if !0 != move_free_distance { if start_hop_info == move_bucket.hop_info.load(Ordering::Acquire) { let new_free_bucket_index = move_bucket_index + move_free_distance as usize; let new_free_bucket = self.segments[new_free_bucket_index].clone(); let mbhi = move_bucket.hop_info.load(Ordering::Acquire); // Updates move bucket's hop data, to indicate the newly inserted bucket move_bucket .hop_info .store(mbhi | (1 << free_dist), Ordering::SeqCst); self.segments[free_bucket_index] .data .replace_with(|_ex| self.extract(new_free_bucket.data.get()).clone()); self.segments[free_bucket_index] .key .replace_with(|_ex| self.extract(new_free_bucket.key.get()).clone()); new_free_bucket.key.replace_with(|_| None); new_free_bucket.data.replace_with(|_| None); // Updates move bucket's hop data, to indicate the deleted bucket move_bucket.hop_info.store( move_bucket.hop_info.load(Ordering::SeqCst) & !(1 << move_free_distance), Ordering::SeqCst, ); free_distance = free_distance - free_dist + move_free_distance as usize; result[0] = free_distance; result[1] = val; result[2] = new_free_bucket_index; return result; } } move_bucket_index = move_bucket_index + 1; move_bucket = self.segments[move_bucket_index].clone(); } self.segments[free_bucket_index].key.replace_with(|_| None); result[0] = 0; result[1] = 0; result[2] = 0; return result; } fn trial(&self) { let mut count = 0; for i in (0..self.max_segments).into_iter() { let temp = self.segments[i].clone(); if temp.key.get().is_some() { count += 1; } } println!("Items in Hash = {}", count); println!("==========================="); } } #[derive(Clone)] struct Bucket<K, V> { hop_info: Arc<AtomicU64>, key: Arc<AtomicBox<Option<K>>>, data: Arc<AtomicBox<Option<V>>>, } impl<K, V> Bucket<K, V> { #[inline] pub fn consume(self) -> Bucket<K, V> { self } } impl<K, V> Default for Bucket<K, V> { fn default() -> Self { Bucket { hop_info: Arc::new(AtomicU64::default()), key: Arc::new(AtomicBox::new(None)), data: Arc::new(AtomicBox::new(None)), } } } #[cfg(test)] mod hoptable_tests { use super::HOPTable; #[test] fn hoptable_inserts() { let hoptable: HOPTable<String, u64> = HOPTable::new(); hoptable.insert("Saudade0".to_string(), 1); hoptable.insert("Saudade1".to_string(), 2); hoptable.insert("Saudade2".to_string(), 3); hoptable.insert("Saudade3".to_string(), 4); hoptable.insert("Saudade4".to_string(), 321321); hoptable.insert("Saudade5".to_string(), 6); hoptable.insert("123123".to_string(), 10); hoptable.insert("1231231".to_string(), 11); hoptable.insert("1231232".to_string(), 12); hoptable.insert("1231233".to_string(), 13); hoptable.insert("1231234".to_string(), 14); hoptable.insert("1231235".to_string(), 15); hoptable.trial(); assert_eq!(hoptable.get(&"Saudade4".to_string()), Some(321321)); } #[test] fn hoptable_removes() { let hoptable: HOPTable<String, u64> = HOPTable::new(); hoptable.insert("Saudade0".to_string(), 1); assert_eq!(hoptable.get(&"Saudade0".to_string()), Some(1)); hoptable.remove(&"Saudade0".to_string()); assert_eq!(hoptable.get(&"Saudade0".to_string()), None); } #[test] fn hoptable_upsert() { let hoptable: HOPTable<String, u64> = HOPTable::new(); hoptable.insert("Saudade0".to_string(), 1); assert_eq!(hoptable.get(&"Saudade0".to_string()), Some(1)); hoptable.insert("Saudade0".to_string(), 2); assert_eq!(hoptable.get(&"Saudade0".to_string()), Some(2)); } #[test] fn hoptable_nonexistent() { let hoptable: HOPTable<u64, u64> = HOPTable::new(); let k1 = 4856049742280869673_u64; let k2 = 2440000773311228611_u64; assert_eq!(hoptable.key_index(&k1), hoptable.key_index(&k2)); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/mod.rs
src/table/mod.rs
pub mod hoptable; /// Lever Transactional Table implementation with [Optimistic](crate::txn::transact::TransactionConcurrency::Optimistic) /// concurrency and [RepeatableRead](crate::txn::transact::TransactionIsolation::RepeatableRead) isolation. pub mod lotable; #[doc(hidden)] pub mod ltable; /// Prelude for transactional KV table implementations pub mod prelude { pub use super::hoptable::*; pub use super::lotable::*; }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/lotable.rs
src/table/lotable.rs
use crate::sync::atomics::AtomicBox; use crate::txn::prelude::*; use std::collections::hash_map::{Iter, Keys, RandomState}; use std::collections::HashMap; use anyhow::Result; use std::collections::hash_map; use std::fmt; use std::hash::Hash; use std::hash::{BuildHasher, Hasher}; use std::ptr::NonNull; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; const DEFAULT_CAP: usize = 1024; #[derive(Clone)] /// /// Lever Transactional Table implementation with [Optimistic](TransactionConcurrency::Optimistic) /// concurrency and [RepeatableRead](TransactionIsolation::RepeatableRead) isolation. /// /// Transactional hash table fully concurrent and as long as no conflicts are made /// it is both lock and wait free. pub struct LOTable<K, V, S = RandomState> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync, V: 'static + Clone + Send + Sync, S: BuildHasher, { latch: Vec<TVar<Arc<AtomicBox<Container<K, V>>>>>, txn_man: Arc<TxnManager>, txn: Arc<Txn>, hash_builder: S, } impl<K, V> LOTable<K, V, RandomState> where K: PartialEq + Eq + Hash + Clone + Send + Sync, V: Clone + Send + Sync, { pub fn new() -> Self { Self::with_capacity(DEFAULT_CAP) } pub fn with_capacity(cap: usize) -> Self { Self::with_capacity_and_hasher(cap, RandomState::new()) } } impl<K, V, S> LOTable<K, V, S> where K: PartialEq + Eq + Hash + Clone + Send + Sync, V: Clone + Send + Sync, S: BuildHasher, { fn with_capacity_and_hasher(cap: usize, hasher: S) -> LOTable<K, V, S> { let txn_man = Arc::new(TxnManager { txid: Arc::new(AtomicU64::new(GLOBAL_VCLOCK.load(Ordering::SeqCst))), }); let txn: Arc<Txn> = Arc::new(txn_man.txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::RepeatableRead, 100_usize, 1_usize, "default".into(), )); Self { latch: vec![TVar::new(Arc::new(AtomicBox::new(Container(HashMap::default())))); cap], txn_man, txn, hash_builder: hasher, } } #[inline] pub fn insert(&self, k: K, v: V) -> Result<Arc<Option<V>>> { let tvar = self.seek_tvar(&k); let container = self.txn.begin(|t| t.read(&tvar))?; let previous: Arc<AtomicBox<Option<V>>> = Arc::new(AtomicBox::new(None)); container.replace_with(|r| { let mut entries = r.0.clone(); let p = entries.insert(k.clone(), v.clone()); previous.replace_with(|_| p.clone()); Container(entries) }); previous.extract() } #[inline] pub fn remove(&self, k: &K) -> Result<Arc<Option<V>>> { let tvar = self.seek_tvar(&k); let container = self.txn.begin(|t| t.read(&tvar))?; let previous: Arc<AtomicBox<Option<V>>> = Arc::new(AtomicBox::new(None)); container.replace_with(|r| { let mut c = r.0.clone(); let p = c.remove(k); previous.replace_with(|_| p.clone()); Container(c) }); previous.extract() } #[inline] pub fn get(&self, k: &K) -> Option<V> { let tvar = self.seek_tvar(k); self.txn .begin(|t| { let container = t.read(&tvar); let entries = container.get(); entries.0.get(k).cloned() }) .unwrap_or(None) } #[inline] pub fn replace_with<F>(&self, k: &K, f: F) -> Option<V> where F: Fn(Option<&V>) -> Option<V>, { let tvar = self.seek_tvar(k); self.txn .begin(|t| { let container = t.read(&tvar); let entries = container.get(); f(entries.0.get(k)) }) .unwrap_or(None) } #[inline] pub fn replace_with_mut<F>(&self, k: &K, mut f: F) -> Option<V> where F: FnMut(&mut Option<V>) -> &mut Option<V>, { let tvar = self.seek_tvar(k); self.txn .begin(|t| { let container = t.read(&tvar); let entries = container.get(); let mut mv = entries.0.get(k).cloned(); f(&mut mv).clone() }) .unwrap_or(None) } #[inline] pub fn contains_key(&self, k: &K) -> bool { let tvar = self.seek_tvar(&k); self.txn .begin(|t| { let container = t.read(&tvar); container.get().0.contains_key(k) }) .unwrap_or(false) } #[inline] pub fn len(&self) -> usize { self.latch .first() .map(move |b| { self.txn .begin(|t| { let container = t.read(&b); container.get().0.len() }) .unwrap_or(0_usize) }) .unwrap_or(0_usize) } #[inline] pub fn iter(&self) -> LOIter<K, V> { LOIter { idx: 0, inner: None, reader: HashMap::default(), current_frame: 0, latch_snapshot: self.latch.clone(), txn: self.txn.clone(), } } #[inline] pub fn clear(&self) { self.latch.iter().for_each(move |b| { let _ = self.txn.begin(|t| { let container = t.read(&b); container.replace_with(|_r| Container(HashMap::default())); }); }); // TODO: (vcq): Shrink to fit as a optimized table. // self.latch.shrink_to_fit(); } pub fn keys<'table>(&'table self) -> impl Iterator<Item = K> + 'table { let buckets: Vec<K> = self .latch .first() .iter() .flat_map(move |b| { self.txn .begin(|t| { let container = t.read(&b); container .get() .0 .keys() .into_iter() .map(Clone::clone) .collect::<Vec<K>>() }) .unwrap_or(vec![]) }) .collect(); buckets.into_iter() } pub fn values<'table>(&'table self) -> impl Iterator<Item = V> + 'table { let buckets: Vec<V> = self .latch .first() .iter() .flat_map(move |b| { self.txn .begin(|t| { let container = t.read(&b); container .get() .0 .values() .into_iter() .map(Clone::clone) .collect::<Vec<V>>() }) .unwrap_or(vec![]) }) .collect(); buckets.into_iter() } fn hash(&self, key: &K) -> usize { let mut hasher = self.hash_builder.build_hasher(); key.hash(&mut hasher); hasher.finish() as usize % self.latch.len() } fn seek_tvar(&self, key: &K) -> TVar<Arc<AtomicBox<Container<K, V>>>> { self.latch[self.hash(key)].clone() } fn fetch_frame(&self, frame_id: usize) -> hash_map::HashMap<K, V> { let frame_tvar = self.latch[frame_id].clone(); match self.txn.begin(|t| t.read(&frame_tvar)) { Ok(init_frame) => init_frame.get().0.clone(), Err(_) => HashMap::new(), } } //////////////////////////////////////////////////////////////////////////////// ////////// Transactional Area //////////////////////////////////////////////////////////////////////////////// pub fn tx_manager(&self) -> Arc<TxnManager> { self.txn_man.clone() } } #[derive(Clone)] struct Container<K, V>(HashMap<K, V>) where K: PartialEq + Hash + Clone + Send + Sync, V: Clone + Send + Sync; impl<K, V, S> Default for LOTable<K, V, S> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync, V: 'static + Clone + Send + Sync, S: Default + BuildHasher, { /// Creates an empty `LOTable<K, V, S>`, with the `Default` value for the hasher. #[inline] fn default() -> LOTable<K, V, S> { LOTable::with_capacity_and_hasher(128, Default::default()) } } impl<K, V, S> fmt::Debug for LOTable<K, V, S> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync + fmt::Debug, V: 'static + Clone + Send + Sync + fmt::Debug, S: std::hash::BuildHasher, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_map().entries(self.iter()).finish() } } pub struct LOIter<'it, K, V> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync, V: 'static + Clone + Send + Sync, { idx: usize, inner: Option<hash_map::Iter<'it, K, V>>, reader: HashMap<K, V>, current_frame: usize, latch_snapshot: Vec<TVar<Arc<AtomicBox<Container<K, V>>>>>, txn: Arc<Txn>, } impl<'it, K, V> Iterator for LOIter<'it, K, V> where K: 'static + PartialEq + Eq + Hash + Clone + Send + Sync, V: 'static + Clone + Send + Sync, { type Item = (K, V); #[inline(always)] fn next(&mut self) -> Option<Self::Item> { if self.idx == 0 { let tvar = &self.latch_snapshot[self.current_frame]; if let Ok(read) = self.txn.begin(|t| { let frame = t.read(&tvar); frame.get().0.clone() }) { self.reader = read; self.inner = Some(unsafe { std::mem::transmute(self.reader.iter()) }); } } let read_iter = self.inner.as_mut().unwrap(); if let Some(x) = read_iter.next() { self.idx += 1; self.inner = Some(read_iter.clone()); Some((x.0.clone(), x.1.clone())) } else { if self.idx == self.reader.len() { self.current_frame += 1; self.idx = 0; } None } } #[inline(always)] fn size_hint(&self) -> (usize, Option<usize>) { let tvar = &self.latch_snapshot[self.current_frame]; if let Ok(frame_len) = self.txn.begin(|t| t.read(&tvar)) { // TODO: (frame_len, Some(max_bound)) is possible. // Written like this to not overshoot the alloc (frame_len.get().0.len(), None) } else { (0, None) } } } #[cfg(test)] mod lotable_tests { use super::LOTable; #[test] fn iter_generator() { let lotable: LOTable<String, u64> = LOTable::new(); lotable.insert("Saudade0".to_string(), 123123); lotable.insert("Saudade0".to_string(), 123); lotable.insert("Saudade1".to_string(), 123123); lotable.insert("Saudade2".to_string(), 123123); lotable.insert("Saudade3".to_string(), 123123); lotable.insert("Saudade4".to_string(), 123123); lotable.insert("Saudade5".to_string(), 123123); lotable.insert("123123".to_string(), 123123); lotable.insert("1231231".to_string(), 123123); lotable.insert("1231232".to_string(), 123123); lotable.insert("1231233".to_string(), 123123); lotable.insert("1231234".to_string(), 123123); lotable.insert("1231235".to_string(), 123123); let res: Vec<(String, u64)> = lotable.iter().collect(); assert_eq!(res.len(), 12); assert_eq!(lotable.get(&"Saudade0".to_string()), Some(123)); } #[test] fn values_iter_generator() { let lotable: LOTable<String, u64> = LOTable::new(); (0..100).into_iter().for_each(|_i| { lotable.insert("Saudade0".to_string(), 123123); lotable.insert("Saudade0".to_string(), 123); lotable.insert("Saudade1".to_string(), 123123); lotable.insert("Saudade2".to_string(), 123123); lotable.insert("Saudade3".to_string(), 123123); lotable.insert("Saudade4".to_string(), 123123); lotable.insert("Saudade5".to_string(), 123123); lotable.insert("123123".to_string(), 123123); lotable.insert("1231231".to_string(), 123123); lotable.insert("1231232".to_string(), 123123); lotable.insert("1231233".to_string(), 123123); lotable.insert("1231234".to_string(), 123123); lotable.insert("1231235".to_string(), 123123); let res: Vec<u64> = lotable.values().into_iter().collect(); // dbg!(&res); assert_eq!(res.len(), 12); }); lotable.clear(); let res: Vec<u64> = lotable.values().into_iter().collect(); assert_eq!(res.len(), 0); (0..1_000).into_iter().for_each(|i| { lotable.insert(format!("{}", i), i as u64); let resvals: Vec<u64> = lotable.values().into_iter().collect(); // dbg!(&resvals); assert_eq!(resvals.len(), i + 1); }); lotable.clear(); let res: Vec<u64> = lotable.values().into_iter().collect(); assert_eq!(res.len(), 0); (0..1_000).into_iter().for_each(|i| { lotable.insert(format!("{}", i), i as u64); let reskeys: Vec<String> = lotable.keys().into_iter().collect(); // dbg!(&reskeys); assert_eq!(reskeys.len(), i + 1); }); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/ltable.rs
src/table/ltable.rs
use crate::txn::prelude::*; use std::{ cell::UnsafeCell, collections::{ hash_map::{RandomState, Values}, BTreeMap, HashMap, }, hash::{self, BuildHasher, Hash}, sync::atomic::AtomicPtr, }; use std::{ borrow::Borrow, fmt, sync::{ atomic::{AtomicU64, Ordering}, Arc, }, }; #[derive(Clone)] pub struct LTable<K, V> where K: PartialEq + Hash, V: Clone, { name: String, latch: HashMap<K, V>, txn_man: Arc<TxnManager>, } impl<K, V> LTable<K, V> where K: PartialEq + Hash + Eq, V: Clone, { pub fn create(name: String) -> Self { // TODO: Separate data from the latch access. let txn_man = Arc::new(TxnManager { txid: Arc::new(AtomicU64::new(GLOBAL_VCLOCK.load(Ordering::SeqCst))), }); Self { latch: HashMap::with_capacity(100), name, txn_man, } } #[inline] pub fn insert(&mut self, k: K, v: V) -> Option<V> { self.latch.insert(k, v) } #[inline] pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where K: Borrow<Q>, Q: Hash + Eq, { self.latch.get(k) } pub fn values(&self) -> Values<K, V> { self.latch.values() } #[inline] pub fn clear(&mut self) { self.latch.clear(); // TODO: Shrink to fit as a optimized table. // self.latch.shrink_to_fit(); } pub fn transactions(&self) -> Arc<TxnManager> { self.txn_man.clone() } } unsafe impl<K, V> Send for LTable<K, V> where K: PartialEq + Clone + hash::Hash + Send, V: Send + Clone, { } unsafe impl<K, V> Sync for LTable<K, V> where K: PartialEq + Clone + hash::Hash + Sync, V: Sync + Clone, { } impl<K, V> fmt::Debug for LTable<K, V> where K: PartialEq + Hash + fmt::Debug, V: Clone + fmt::Debug, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("LTable") .field("table", &self.latch) .finish() } } #[cfg(test)] mod ltable_tests { use super::*; #[test] fn ltable_creation() { let _ltable = LTable::<String, String>::create("test1".to_owned()); } #[test] #[allow(unused_assignments)] fn ltable_transaction_begin() { let ltable = LTable::<String, String>::create("test1".to_owned()); let txn = ltable.transactions().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::RepeatableRead, 100_usize, 1_usize, "txn_label".into(), ); let mut tvar = TVar::new(ltable); let mut res = txn .begin(|t: &mut Txn| { let mut x = t.read(&tvar); x.insert("taetigkeit".into(), "ingenieur".into()); // dbg!(&tvar.get_data()); t.write(&mut tvar, x.clone()); t.read(&tvar) }) .unwrap(); dbg!(&res); assert_eq!( *res.get("taetigkeit".into()).unwrap(), "ingenieur".to_string() ); txn.begin(|t| { let x = t.read(&tvar); dbg!(&x); assert_eq!(x.get("taetigkeit".into()), Some(&String::from("ingenieur"))); }); res = txn .begin(|t| { let mut x = t.read(&tvar); x.insert("a".into(), "b".into()); x }) .unwrap(); // Repetitive insert 2 res = txn .begin(|te| { let mut x = te.read(&tvar); x.insert("a".into(), "b".into()); x }) .unwrap(); // Repeatable Reads assert_eq!( res.get("taetigkeit".into()), Some(&String::from("ingenieur")) ); // Committed Reads - Read Committed assert_eq!(res.get("a".into()).cloned().unwrap(), "b".to_string()); } #[test] #[allow(unused_assignments)] fn ltable_transaction_tvar() { let ltable = LTable::<String, String>::create("test1".to_owned()); let txn = ltable.transactions().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::RepeatableRead, 100_usize, 1_usize, "txn_label".into(), ); let mut tvar = TVar::new(ltable); let mut res = txn .begin(|t: &mut Txn| { let mut x = t.read(&tvar); x.insert("taetigkeit".into(), "ingenieur".into()); // dbg!(&tvar.get_data()); t.write(&mut tvar, x.clone()); t.read(&tvar) }) .unwrap(); dbg!("TVAR_RES", &res); tvar.open_write(res.clone()); dbg!("TVAR", tvar.get_data()); assert_eq!( *res.get("taetigkeit".into()).unwrap(), "ingenieur".to_string() ); txn.begin(|t| { let x = t.read(&tvar); dbg!(&x); assert_eq!(x.get("taetigkeit".into()), Some(&String::from("ingenieur"))); }); res = txn .begin(|t| { let mut x = t.read(&tvar); x.insert("a".into(), "b".into()); x }) .unwrap(); // Repetitive insert 2 res = txn .begin(|te| { let mut x = te.read(&tvar); x.insert("a".into(), "b".into()); x }) .unwrap(); // Repeatable Reads assert_eq!( res.get("taetigkeit".into()), Some(&String::from("ingenieur")) ); // Committed Reads - Read Committed assert_eq!(res.get("a".into()).cloned().unwrap(), "b".to_string()); } fn sum_table(table: &LTable<String, i64>) -> i64 { table.values().map(|f| *f).sum::<i64>() } #[test] #[cfg_attr(miri, ignore)] fn ltable_transaction_threaded_light() { let mut ltable1 = LTable::<String, i64>::create("alice_1_banking".to_owned()); let mut ltable2 = LTable::<String, i64>::create("alice_2_banking".to_owned()); let ltable3 = LTable::<String, i64>::create("bob_banking".to_owned()); ltable1.insert("alice1_init".into(), 50); ltable2.insert("alice2_init".into(), 50); let txn = TxnManager::manager().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::Serializable, 100_usize, 1_usize, "txn_label".into(), ); let alice_accounts = [TVar::new(ltable1), TVar::new(ltable2)]; let bob_account = TVar::new(ltable3); for _ in 0..10 { let txn = txn.clone(); let mut threads = vec![]; for thread_no in 0..2 { let txn = txn.clone(); let mut alice_accounts = alice_accounts.clone(); let mut bob_account = bob_account.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { // assert!(!is_contended()); for i in 0..2 { if (i + thread_no) % 2 == 0 { // try to transfer let withdrawal_account = thread_no % alice_accounts.len(); txn.begin(|t| { let mut a0 = t.read(&alice_accounts[0]); let mut a1 = t.read(&alice_accounts[1]); let mut b = t.read(&bob_account); let sum = sum_table(&a0) + sum_table(&a1); if sum >= 100 { if withdrawal_account == 0 { a0.insert(format!("from_t_{}", thread_no), -100); } else { a1.insert(format!("from_t_{}", thread_no), -100); } b.insert(format!("to_t_{}", thread_no), 100); } t.write(&mut alice_accounts[0], a0.clone()); t.write(&mut alice_accounts[1], a1.clone()); t.write(&mut bob_account, b.clone()); }) .unwrap(); } else { // assert that the sum of alice's accounts // never go negative // let r0: &LTable<String, i64> = &*alice_accounts[0]; let r = txn .begin(|_t| { ( sum_table(&*alice_accounts[0]), sum_table(&*alice_accounts[1]), sum_table(&*bob_account), ) }) .unwrap(); // dbg!("TESTRESULT", &r); assert!( r.0 + r.1 >= 0, "possible write skew anomaly detected! expected the \ sum of alice's accounts to be >= 0. observed values: {:?}", r ); assert_ne!( r.2, 200, "A double-transfer to bob was detected! \ read values: {:?}", r ); // reset accounts txn.begin(|_t| { (*alice_accounts[0]).clear(); (*alice_accounts[0]).insert("alice1_init".into(), 50); (*alice_accounts[1]).clear(); (*alice_accounts[1]).insert("alice2_init".into(), 50); (*bob_account).clear(); }); } } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { t.join().unwrap(); } } } #[test] #[cfg_attr(miri, ignore)] fn ltable_transaction_threaded_heavy() { let mut ltable1 = LTable::<String, i64>::create("alice_1_banking".to_owned()); let mut ltable2 = LTable::<String, i64>::create("alice_2_banking".to_owned()); let ltable3 = LTable::<String, i64>::create("bob_banking".to_owned()); ltable1.insert("alice1_init".into(), 50); ltable2.insert("alice2_init".into(), 50); let txn = TxnManager::manager().txn_build( TransactionConcurrency::Optimistic, TransactionIsolation::Serializable, 100_usize, 1_usize, "txn_label".into(), ); let alice_accounts = [TVar::new(ltable1), TVar::new(ltable2)]; let bob_account = TVar::new(ltable3); for _ in 0..10 { let txn = txn.clone(); let mut threads = vec![]; for thread_no in 0..20 { let txn = txn.clone(); let mut alice_accounts = alice_accounts.clone(); let mut bob_account = bob_account.clone(); let t = std::thread::Builder::new() .name(format!("t_{}", thread_no)) .spawn(move || { // assert!(!is_contended()); for i in 0..500 { if (i + thread_no) % 2 == 0 { // try to transfer let withdrawal_account = thread_no % alice_accounts.len(); txn.begin(|t| { let mut a0 = t.read(&alice_accounts[0]); let mut a1 = t.read(&alice_accounts[1]); let mut b = t.read(&bob_account); let sum = sum_table(&a0) + sum_table(&a1); if sum >= 100 { if withdrawal_account == 0 { a0.insert(format!("from_t_{}", thread_no), -100); } else { a1.insert(format!("from_t_{}", thread_no), -100); } b.insert(format!("to_t_{}", thread_no), 100); } t.write(&mut alice_accounts[0], a0.clone()); t.write(&mut alice_accounts[1], a1.clone()); t.write(&mut bob_account, b.clone()); }); } else { // assert that the sum of alice's accounts // never go negative let r = txn .begin(|_t| { ( sum_table(&*alice_accounts[0]), sum_table(&*alice_accounts[1]), sum_table(&*bob_account), ) }) .unwrap(); // dbg!("TESTRESULT", &r); assert!( r.0 + r.1 >= 0, "possible write skew anomaly detected! expected the \ sum of alice's accounts to be >= 0. observed values: {:?}", r ); assert_ne!( r.2, 200, "A double-transfer to bob was detected! \ read values: {:?}", r ); // reset accounts txn.begin(|_t| { (*alice_accounts[0]).clear(); (*alice_accounts[0]).insert("alice1_init".into(), 50); (*alice_accounts[1]).clear(); (*alice_accounts[1]).insert("alice2_init".into(), 50); (*bob_account).clear(); }); } } }) .unwrap(); threads.push(t); } for t in threads.into_iter() { t.join().unwrap(); } } } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/rerwlock.rs
src/sync/rerwlock.rs
use super::{ ifaces::RwLockIface, ttas::{TTas, TTasGuard}, }; use std::cell::UnsafeCell; use std::{ fmt, time::{Duration, Instant}, }; use std::{ marker::PhantomData as marker, ops::{Deref, DerefMut}, }; use std::{thread, thread::ThreadId}; const READ_OPTIMIZED_ALLOC: usize = 50_usize; struct ThreadRef { id: ThreadId, count: usize, } impl ThreadRef { #[inline] pub fn new(count: usize) -> Self { Self { id: thread::current().id(), count, } } #[inline] pub fn is_current(&self) -> bool { thread::current().id() == self.id } #[inline] pub fn try_inc(&mut self) -> bool { if self.is_current() { self.count = match self.count.checked_add(1) { Some(x) => x, _ => return false, }; true } else { false } } #[inline] pub fn try_dec(&mut self) -> bool { if self.is_current() { self.count = match self.count.checked_sub(1) { Some(x) => x, _ => return false, }; true } else { false } } #[inline] pub fn is_positive(&self) -> bool { self.count > 0 } } impl fmt::Debug for ThreadRef { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("ThreadRef") .field("id", &self.id) .field("count", &self.count) .finish() } } struct Container { writer: Option<ThreadRef>, readers: Vec<ThreadRef>, } impl Container { pub fn new() -> Self { Self { writer: None, readers: Vec::with_capacity(READ_OPTIMIZED_ALLOC), } } pub fn readers_from_single_thread(&self) -> (bool, Option<&ThreadRef>) { let mut reader = None; for counter in self.readers.iter() { if counter.is_positive() { match reader { Some(_) => return (false, None), None => reader = Some(counter), } } } (true, reader) } fn readers_for_current_thread(&mut self) -> &mut ThreadRef { match self.readers.iter().position(|c| c.is_current()) { Some(index) => &mut self.readers[index], None => { self.readers.push(ThreadRef::new(0_usize)); self.readers .last_mut() .expect("Last element was just added right before!") } } } fn writer_from_current_thread(&mut self) -> bool { self.writer.as_ref().map_or(false, |ow| ow.is_current()) } } // Write Guard pub struct ReentrantWriteGuard<'a, T: ?Sized> where ReentrantRwLock<T>: 'a, { lock: &'a ReentrantRwLock<T>, marker: marker<&'a mut T>, } impl<'a, T: ?Sized> Deref for ReentrantWriteGuard<'a, T> where ReentrantRwLock<T>: 'a, { type Target = T; fn deref(&self) -> &T { unsafe { &*self.lock.data.get() } } } impl<'a, T: ?Sized> DerefMut for ReentrantWriteGuard<'a, T> where ReentrantRwLock<T>: 'a, { fn deref_mut(&mut self) -> &mut T { unsafe { &mut *self.lock.data.get() } } } impl<'a, T: ?Sized> Drop for ReentrantWriteGuard<'a, T> { fn drop(&mut self) { let mut c = self.lock.get_container().unwrap(); c.try_release_write(); if thread::panicking() { // TODO: Drop all the guards on poisoned data. // c.try_release_write(); c.try_release_read(); } } } impl<'a, T> fmt::Debug for ReentrantWriteGuard<'a, T> where T: fmt::Debug + ?Sized + 'a, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&**self, f) } } impl<'a, T> fmt::Display for ReentrantWriteGuard<'a, T> where T: fmt::Display + ?Sized + 'a, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { (**self).fmt(f) } } // Read Guard pub struct ReentrantReadGuard<'a, T: ?Sized> where ReentrantRwLock<T>: 'a, { lock: &'a ReentrantRwLock<T>, marker: marker<&'a T>, } impl<'a, T: ?Sized> Deref for ReentrantReadGuard<'a, T> where ReentrantRwLock<T>: 'a, { type Target = T; fn deref(&self) -> &T { unsafe { &*self.lock.data.get() } } } impl<'a, T: ?Sized> Drop for ReentrantReadGuard<'a, T> { fn drop(&mut self) { self.lock.get_container().unwrap().try_release_read(); } } impl<'a, T> fmt::Debug for ReentrantReadGuard<'a, T> where T: fmt::Debug + ?Sized + 'a, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&**self, f) } } impl<'a, T> fmt::Display for ReentrantReadGuard<'a, T> where T: fmt::Display + ?Sized + 'a, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { (**self).fmt(f) } } /// /// Lock-free Reentrant RW Lock implementation. pub struct ReentrantRwLock<T> where T: ?Sized, { container: TTas<Container>, data: UnsafeCell<T>, } unsafe impl<T: ?Sized + Send> Send for ReentrantRwLock<T> {} unsafe impl<T: ?Sized + Send> Sync for ReentrantRwLock<T> {} impl<T> ReentrantRwLock<T> where T: ?Sized, { #[inline] pub fn get_mut(&mut self) -> &mut T { unsafe { &mut *self.data.get() } } #[inline] fn get_container(&self) -> Option<TTasGuard<Container>> { self.container.try_lock() } } impl<T> ReentrantRwLock<T> { pub fn new(data: T) -> Self { Self { container: TTas::new(Container::new()), data: UnsafeCell::new(data), } } #[inline] pub fn into_inner(self) -> T { self.data.into_inner() } // Exposed methods #[inline] pub fn read(&self) -> ReentrantReadGuard<'_, T> { loop { match self.try_read() { Some(guard) => return guard, None => thread::yield_now(), } } } #[inline] pub fn try_read(&self) -> Option<ReentrantReadGuard<'_, T>> { let cont = self.get_container(); match cont { Some(mut c) => { if c.try_lock_read() { Some(ReentrantReadGuard { lock: self, marker }) } else { None } } _ => None, } } #[inline] pub fn write(&self) -> ReentrantWriteGuard<'_, T> { loop { match self.try_write() { Some(guard) => return guard, None => thread::yield_now(), } } } #[inline] pub fn try_write(&self) -> Option<ReentrantWriteGuard<'_, T>> { let cont = self.get_container(); match cont { Some(mut c) => { if c.try_lock_write() { Some(ReentrantWriteGuard { lock: self, marker }) } else { None } } _ => None, } } #[inline] pub fn is_locked(&self) -> bool { self.try_write().is_none() } #[inline] pub fn try_write_lock_for(&self, timeout: Duration) -> Option<ReentrantWriteGuard<'_, T>> { let deadline = Instant::now() .checked_add(timeout) .expect("Deadline can't fit in"); loop { if Instant::now() < deadline { match self.try_write() { Some(guard) => { break Some(guard); } _ => { std::thread::sleep(timeout / 10); std::thread::yield_now() } }; } else { break None; } } } #[inline] pub fn is_writer_held_by_current(&self) -> bool { loop { if let Some(mut cont) = self.get_container() { break cont.writer_from_current_thread(); } else { thread::yield_now(); } } } } unsafe impl RwLockIface for Container { fn try_lock_read(&mut self) -> bool { if let Some(holder) = &mut self.writer { if !holder.is_current() { return false; } } self.readers_for_current_thread().try_inc() } fn try_release_read(&mut self) -> bool { self.readers_for_current_thread().try_dec() } fn try_lock_write(&mut self) -> bool { if let Some(holder) = &mut self.writer { return holder.try_inc(); } match self.readers_from_single_thread() { (true, Some(holder)) => { if !holder.is_current() { return false; } } // (true, None) => {} (false, _) => return false, _ => {} } self.writer = Some(ThreadRef::new(1_usize)); true } fn try_release_write(&mut self) -> bool { match &mut self.writer { Some(holder) => holder.try_dec(), None => false, } } } #[cfg(test)] mod reentrant_lock_tests { use super::*; #[test] fn rwlock_create_and_reacquire_write_lock() { let rew = ReentrantRwLock::new(144); let data = rew.try_read(); assert!(data.is_some()); assert!(rew.try_read().is_some()); assert!(rew.try_read().is_some()); core::mem::drop(data); assert!(rew.try_write().is_some()); assert!(rew.try_read().is_some()); } #[test] fn rwlock_create_and_reacquire_read_lock() { let rew = ReentrantRwLock::new(144); let data = rew.try_read(); assert!(data.is_some()); assert!(rew.try_read().is_some()); assert!(rew.try_read().is_some()); core::mem::drop(data); assert!(rew.try_read().is_some()); assert!(rew.try_write().is_some()); } #[test] fn rwlock_reacquire_without_drop() { let rew = ReentrantRwLock::new(144); let datar = rew.read(); assert_eq!(*datar, 144); assert!(rew.try_read().is_some()); assert!(rew.try_read().is_some()); assert!(rew.try_write().is_some()); // Write data while holding read guard let mut dataw = rew.write(); *dataw += 288; // Read after write guard let datar2 = rew.read(); assert_eq!(*datar2, 432); } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/arcunique.rs
src/sync/arcunique.rs
use std::convert::TryFrom; use std::ops::{Deref, DerefMut}; use std::ptr::NonNull; use std::sync::Arc; pub struct ArcUnique<T: Clone>(NonNull<T>); impl<T: Clone> From<T> for ArcUnique<T> { fn from(value: T) -> Self { unsafe { Self(NonNull::new_unchecked( Arc::into_raw(Arc::new(value)) as *mut T )) } } } impl<T: Clone> TryFrom<Arc<T>> for ArcUnique<T> { type Error = Arc<T>; fn try_from(mut arc: Arc<T>) -> Result<Self, Arc<T>> { if Arc::get_mut(&mut arc).is_some() { unsafe { Ok(Self(NonNull::new_unchecked(Arc::into_raw(arc) as *mut T))) } } else { Err(arc) } } } impl<T: Clone> Into<Arc<T>> for ArcUnique<T> { fn into(self) -> Arc<T> { unsafe { Arc::from_raw(self.0.as_ptr()) } } } impl<T: Clone> Deref for ArcUnique<T> { type Target = T; fn deref(&self) -> &T { unsafe { self.0.as_ref() } } } impl<T: Clone> DerefMut for ArcUnique<T> { fn deref_mut(&mut self) -> &mut T { unsafe { self.0.as_mut() } } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/ifaces.rs
src/sync/ifaces.rs
pub unsafe trait LockIface { fn lock(&self); fn try_lock(&self) -> bool; fn is_locked(&self) -> bool; fn unlock(&self); fn try_unlock(&self) -> bool; } pub unsafe trait RwLockIface { fn try_lock_read(&mut self) -> bool; fn try_release_read(&mut self) -> bool; fn try_lock_write(&mut self) -> bool; fn try_release_write(&mut self) -> bool; }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/atomics.rs
src/sync/atomics.rs
use crate::sync::arcunique::ArcUnique; use anyhow::Result; use std::convert::TryFrom; use std::ops::Deref; use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::Arc; /// AtomicBox<T> is a safe wrapper around AtomicPtr<T> #[derive(Debug)] pub struct AtomicBox<T: Sized> { ptr: AtomicPtr<T>, } impl<T: Sized> AtomicBox<T> { /// /// Allocates a new AtomicBox containing the given value pub fn new(value: T) -> AtomicBox<T> { AtomicBox { ptr: AtomicPtr::new(AtomicBox::alloc_from(value)), } } #[inline] fn alloc_from(value: T) -> *mut T { let total: Arc<T> = Arc::new(value); Arc::into_raw(total) as *mut T } fn strongest_failure_ordering(order: Ordering) -> Ordering { use Ordering::*; match order { Release => Relaxed, Relaxed => Relaxed, SeqCst => SeqCst, Acquire => Acquire, AcqRel => Acquire, _ => unsafe { std::hint::unreachable_unchecked() }, } } fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) -> *mut T { match self.ptr.compare_exchange( current, new, order, Self::strongest_failure_ordering(order), ) { Ok(x) => x, Err(x) => x, } } fn take(&self) -> Arc<T> { loop { let curr = self.ptr.load(Ordering::Acquire); let null: *mut T = std::ptr::null_mut(); if curr == null { continue; } if self.compare_and_swap(curr, null, Ordering::AcqRel) == curr { return unsafe { Arc::from_raw(curr) }; } } } fn release(&self, ptr: *mut T) { self.ptr.store(ptr, Ordering::Release); } /// /// Get inner value pub fn get(&self) -> Arc<T> { let val = self.take(); let copy = Arc::clone(&val); let ptr = Arc::into_raw(val) as *mut T; self.release(ptr); copy } /// /// Extract mutable pointer of the contained value pub fn extract_mut_ptr(&mut self) -> *mut T { let x = self.get(); Arc::into_raw(x) as *mut T } /// /// If possible, extract inner value into unique Arc pub fn extract(&self) -> Result<Arc<T>> { let au: ArcUnique<Arc<T>> = ArcUnique::try_from(self.get())?; Ok(au.deref().clone()) } /// /// Atomically replace the inner value with the result of applying the /// given closure to the current value pub fn replace_with<F>(&self, f: F) where F: FnOnce(Arc<T>) -> T, { let val = self.take(); let new_val = f(val); let ptr = Arc::into_raw(Arc::new(new_val)) as *mut T; self.release(ptr); } /// /// Atomically replace the inner value with the given one. pub fn replace(&self, new_val: T) { let ptr = Arc::into_raw(Arc::new(new_val)) as *mut T; self.release(ptr); } } impl<T: Sized + PartialEq> PartialEq for AtomicBox<T> { fn eq(&self, other: &AtomicBox<T>) -> bool { self == other } } impl<T: Sized> Drop for AtomicBox<T> { fn drop(&mut self) { unsafe { Arc::from_raw(self.ptr.load(Ordering::Acquire)) }; } } unsafe impl<T: Sized + Sync> Sync for AtomicBox<T> {} unsafe impl<T: Sized + Send> Send for AtomicBox<T> {} #[cfg(test)] mod tests { use std::sync::{Arc, Barrier}; use std::thread; use super::AtomicBox; #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_new() { let b = AtomicBox::new(1024); assert_eq!(*b.get(), 1024); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_replace_with() { let value: i64 = 1024; let b = AtomicBox::new(value); b.replace_with(|x| *x * 2); assert_eq!(*b.get(), value * 2); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_replace_with_ten_times() { let value = 1024; let b = AtomicBox::new(value); for _i in 0..10 { b.replace_with(|x| *x * 2); } assert_eq!(*b.get(), value * 2_i32.pow(10)); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_replace_instance() { let b = Arc::new(AtomicBox::new(1024)); let b1 = b.clone(); b1.replace_with(|x| *x * 2); assert_eq!(*b.get(), 2048); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_threaded_leak_test() { let val = Arc::new(AtomicBox::new(10)); let val_cpys: Vec<Arc<AtomicBox<i32>>> = (0..10).map(|_| val.clone()).collect(); let mut guards = Vec::new(); for i in 0..10 { let val_cpy = val_cpys[i].clone(); let guard = thread::spawn(move || { val_cpy.replace_with(|x| *x * 2); }); guards.push(guard); } for g in guards { g.join().unwrap(); } assert_eq!(*val.get(), 10 * 2_i32.pow(10)); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_threaded_contention() { let abox = Arc::new(AtomicBox::new(0)); let thread_num = 10; let mut guards = Vec::new(); let barrier = Arc::new(Barrier::new(thread_num)); for _i in 0..thread_num { let b = Arc::clone(&barrier); let cpy = abox.clone(); guards.push(thread::spawn(move || { b.wait(); for _j in 0..1000 { cpy.replace_with(|x| *x + 100) } })); } for g in guards { g.join().unwrap(); } assert_eq!(*abox.get(), thread_num * 1000 * 100); } #[test] #[cfg_attr(miri, ignore)] fn atomic_arc_vector_container() { let values: Vec<i32> = (0..10).map(|x: i32| x.pow(2)).collect(); let abox = Arc::new(AtomicBox::new(vec![])); let mut guards = Vec::new(); for i in 0..10 { let cpy = abox.clone(); let values: Vec<i32> = values.clone(); guards.push(thread::spawn(move || { cpy.replace_with(|x| { let mut nx = (*x).clone(); nx.push(values[i]); nx }) })); } for g in guards { g.join().unwrap(); } assert_eq!(abox.get().len(), values.len()); for i in values { assert_eq!(abox.get().contains(&i), true); } } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/mod.rs
src/sync/mod.rs
/// Ifaces for lock-free concurrency primitives pub mod ifaces; pub(crate) mod arcunique; /// Atomic heap location pub mod atomics; /// Tas based reentrant RW lock implementation pub mod rerwlock; /// Basic treiber stack pub mod treiber; /// TTas based spin lock implementation pub(crate) mod ttas; /// /// Prelude for the synchronization primitives pub mod prelude { pub use super::rerwlock::*; pub use super::treiber::*; pub use super::ttas::*; }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/treiber.rs
src/sync/treiber.rs
use std::mem::ManuallyDrop; use std::ptr; use std::sync::atomic::Ordering; use std::sync::atomic::Ordering::{Acquire, Relaxed, Release}; use crossbeam_epoch as epoch; use crossbeam_epoch::{Atomic, Owned}; // Taken from crossbeam. // // TODO: Make elimination for the stack. // This will perform bad. /// Treiber's lock-free stack. /// /// Usable with any number of producers and consumers. #[derive(Debug)] pub struct TreiberStack<T> { head: Atomic<Node<T>>, } #[derive(Debug)] struct Node<T> { data: ManuallyDrop<T>, next: Atomic<Node<T>>, } impl<T> TreiberStack<T> { /// Creates a new, empty stack. pub fn new() -> TreiberStack<T> { TreiberStack { head: Atomic::null(), } } fn strongest_failure_ordering(order: Ordering) -> Ordering { use Ordering::*; match order { Release => Relaxed, Relaxed => Relaxed, SeqCst => SeqCst, Acquire => Acquire, AcqRel => Acquire, _ => unsafe { std::hint::unreachable_unchecked() }, } } /// Pushes a value on top of the stack. pub fn push(&self, t: T) { let mut n = Owned::new(Node { data: ManuallyDrop::new(t), next: Atomic::null(), }); let guard = epoch::pin(); loop { let head = self.head.load(Relaxed, &guard); n.next.store(head, Relaxed); match self.head.compare_exchange( head, n, Release, Self::strongest_failure_ordering(Release), &guard, ) { Ok(_) => break, Err(e) => n = e.new, } } } /// Attempts to pop the top element from the stack. /// /// Returns `None` if the stack is empty. pub fn pop(&self) -> Option<T> { let guard = epoch::pin(); loop { let head = self.head.load(Acquire, &guard); match unsafe { head.as_ref() } { Some(h) => { let next = h.next.load(Relaxed, &guard); if self .head .compare_exchange( head, next, Relaxed, Self::strongest_failure_ordering(Relaxed), &guard, ) .is_ok() { unsafe { guard.defer_destroy(head); return Some(ManuallyDrop::into_inner(ptr::read(&(*h).data))); } } } None => return None, } } } /// Returns `true` if the stack is empty. pub fn is_empty(&self) -> bool { let guard = epoch::pin(); self.head.load(Acquire, &guard).is_null() } }
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false