Packages
pillar
0.2.0
0.40.0
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
0.34.1
0.34.0
0.33.1
0.33.0
0.32.0
0.31.0
0.30.0
0.29.1
0.29.0
0.28.0
0.27.0
0.26.1
0.26.0
0.25.1
0.25.0
0.24.0
0.23.3
0.23.2
0.23.1
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.2
0.18.1
0.18.0
0.17.3
0.17.2
0.17.1
0.17.0
0.16.2
0.16.1
0.16.0
0.15.0
0.14.0
0.13.1
0.13.0
0.12.0
0.11.0
0.10.0
0.9.1
0.9.0
0.8.1
0.8.0
0.7.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.0
Elixir client for ClickHouse, a fast open-source Online Analytical Processing (OLAP) database management system.
Current section
Files
Jump to
Current section
Files
lib/vin_decode/dictionaries/years.ex
defmodule VinDecode.Dictionaries.Years do
@moduledoc false
@data_from1981to2009 %{
"B" => 1981,
"C" => 1982,
"D" => 1983,
"E" => 1984,
"F" => 1985,
"G" => 1986,
"H" => 1987,
"J" => 1988,
"K" => 1989,
"L" => 1990,
"M" => 1991,
"N" => 1992,
"P" => 1993,
"R" => 1994,
"S" => 1995,
"T" => 1996,
"V" => 1997,
"W" => 1998,
"X" => 1999,
"Y" => 2000,
"1" => 2001,
"2" => 2002,
"3" => 2003,
"4" => 2004,
"5" => 2005,
"6" => 2006,
"7" => 2007,
"8" => 2008,
"9" => 2009
}
@data_from2010to2039 %{
"A" => 2010,
"B" => 2011,
"C" => 2012,
"D" => 2013,
"E" => 2014,
"F" => 2015,
"G" => 2016,
"H" => 2017,
"J" => 2018,
"K" => 2019,
"L" => 2020,
"M" => 2021,
"N" => 2022,
"P" => 2023,
"R" => 2024,
"S" => 2025,
"T" => 2026,
"V" => 2027,
"W" => 2028,
"X" => 2029,
"Y" => 2030,
"1" => 2031,
"2" => 2032
}
def year(vin) do
char7 = String.at(vin, 6)
char10 = String.at(vin, 9)
case Integer.parse(char7) do
:error -> @data_from2010to2039[char10]
{_number, _binary} -> @data_from1981to2009[char10]
end
end
end